Git config alias no longer works

I used the command:

git config --global alias.st status 

to add your first alias as suggested by the post - How to execute alias commands in git?

Then I found that it is being added to the configuration file at:

C: \ Users \ damodar.bashyal \ .gitconfig

So, I added a bunch of aliases directly in the configuration file, and everything worked fine until today, when I had to restart my computer after installing the MYOB software.

When I tried to use an alias, no one worked. So, I added another alias using the above command, but the file did not update, but the new alias worked fine.

So, after a long crash, I found the command in [ Where is git config --global written to? ] to search for a configuration file:

 git config --global --edit 

To my surprise, it showed a different location with the git alias added to it.

 .gitconfig(~) - VIM [gui] recentrepo = C:/_projects/example.com/trunk/bitbucket [user] name = damu [alias] st = status 

Is there a way to change the return path to the previous .gitconfig file?

I use windows 7 and msysgit.

 c:\>echo %HOME% %HOME% c:\>set HOME HOMEDRIVE=U: HOMEPATH=\ HOMESHARE=\\agsbs\UserShares\Damodar.Bashyal c:\>echo %HOME% %HOME% 

UPDATE: after that [ Change user location (home variable) in Egit (Eclipse) ] to set the missing HOME environment variable, and now I get the following:

 c:\>set HOME HOME=C:\Users\damodar.bashyal HOMEDRIVE=U: HOMEPATH=\ HOMESHARE=\\agsbs\UserShares\Damodar.Bashyal 

This also fixed my problem. YAY !!!

+4
source share
1 answer

Check your HOME links:

 echo %HOME% # or set HOME 

git config --global will refer to the HOME path (unless you use the -file option ).
HOME is not defined by default on Windows, but is installed by the git-cmd.bat script included in msysgit.

 @if not exist "%HOME%" @set HOME=%HOMEDRIVE%%HOMEPATH% @if not exist "%HOME%" @set HOME=%USERPROFILE% 
+2
source

Source: https://habr.com/ru/post/1443127/


All Articles