I am working with the latest Git bash for Windows, on my laptop running Windows 7.
When I define my aliases like:
$ alias gitc='git commit -a'
Everything works well during the session, but I cannot recover them if I close and open the bash.
The command history is preserved, though.
What should I do? What I have missed?
Thanks!
When you open the git bash type in the command
touch .bash_profile.Following this type
vim .bash_profile.You can then add your aliases to this file. Save the file and reopen the git bash and your aliases should work as expected.
This method allows you to create aliases for any bash command available in git bash however as others have answered it is also possible to create git specific aliases using git itself.