I'm using Git Bash on Windows 7 and would like to set up bash profile aliases such as
alias gs='git status' to make my life easier. How can I do this?
When you open up your Git Bash, you should be by default in your home directory. Now create the .bashrc file (if on Win7 the file should be named .bashrc.). If you're not in the home directory change into it with:
You can create the file with:
Then edit it with vim or you could try doing it with some windows editor, but i don't recommend it, because of some text formatting issues.
Change to Insert Mode by hitting the i key.
Add your alias:
Exit the insert mode with ESC. And save-then-close your file with the following :wqEnter.
Finally source the file our open a new git bash.
You can put
You can also create some git-only aliases so you can do just
Some other useful aliases: