git aliases in cygwin
J
progman3k@gmail.com
Fri Aug 29 12:25:51 GMT 2025
Hello!
I'm trying understand the proper way to acheive a git-decorated-prompt
under cygwin.
When using git-bash in Windows, it automatically sets the prompt to reflect
the current repositor branch when cd'ing to a folder that contains a git
sandbox.
To obtain this effect under Ubuntu, it was necessary to set the PS1
(prompt) variable in ~/.bashrc to the following:
export PS1='\[\033]0;$TITLEPREFIX:$PWD\007\]\n\[\033[32m\]\u@\h
\[\033[35m\]$MSYSTEM \[\033[33m\]\w\[\033[36m\]`__git_ps1`\[\033[0m\]\n$ '
This appears to work by using the aliases that the git package installs.
Since Ubuntu is general-purpose and not for a specific use like git-bash
is, it does not automatically set the prompt for you.
For Gentoo, setting the PS1 variable in ~/.bashrc did not work, because
even after installing git, it did not install its aliases in the profiles.
So for Gentoo, putting the following line in ~/.bashrc made the prompt
variable acheive the desired effect:
. /usr/share/git/git-prompt.sh
Now on to Cygwin.
Even though I've installed git, the git aliases don't seem to be present,
or at least I can't figure out how to get them set.
Thank you for reading, and thank you in advance
More information about the Cygwin
mailing list