Git config alias doesn't work anymore
I used command:
git config --global alias.st status
to add my first alias as suggested by post – How do I alias commands in git?
Then, I found it being added to config file at:
So, i added bunch of aliases directly on the config file and all worked perfectly until today when I had to restart my computer after installing MYOB software.
When i tried to use alias none worked. So, i added another alias using above command, but the file didn’t get updated but new alias worked fine.
So after struggling for a while found a command at [ Where does git config –global get written to? ] to look for the config file:
git config --global --edit
To my surprise, it was showing different location with new git alias added in it.
.gitconfig(~) - VIM [gui] recentrepo = C:/_projects/example.com/trunk/bitbucket [user] name = damu [alias] st = status
Is there a way to change back path to previous .gitconfig file?
c:\>echo %HOME% %HOME% c:\>set HOME HOMEDRIVE=U: HOMEPATH=\ HOMESHARE=\\agsbs\UserShares\Damodar.Bashyal c:\>echo %HOME% %HOME%
followed this post [ Change User location(home variable) in Egit (Eclipse) ] to set missing HOME environment variable and now i am getting this:
c:\>set HOME HOME=C:\Users\damodar.bashyal HOMEDRIVE=U: HOMEPATH=\ HOMESHARE=\\agsbs\UserShares\Damodar.Bashyal
That also fixed my issue. YAY!!!
One Solution collect form web for “Git config alias doesn't work anymore”
Check what your
echo %HOME% # or set HOME
git config --global will reference the
HOME path (unless you would use the –file option).
HOME isn’t defined by default on Windows, but it is set by the
git-cmd.bat script included with msysgit.
@if not exist "%HOME%" @set HOME=%HOMEDRIVE%%HOMEPATH% @if not exist "%HOME%" @set HOME=%USERPROFILE%