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?

  • Unable to initialize SMTP properly using GIT
  • Copying git tags from one repository to another
  • Why did git not notice this inline change?
  • how do I complete a git commit?
  • Dependency projects in a TFS Git project VNEXT build
  • Push existing project into Github
  • Then, I found it being added to config file at:

    C:\Users\damodar.bashyal\.gitconfig

    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?

    I am using windows 7 and msysgit.

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

    UPDATE:
    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!!!

  • Multiple ssh keys are not working
  • How do I commit case-sensitive only filename changes in Git?
  • Git: How to rebase many branches (with the same base commit) at once?
  • How to deal with merges of topic branches after a squashed merge of parent
  • What i need to take care to upgrade from git 1.9.5 to latest 2.6?
  • How can I repair my git configuration?
  • One Solution collect form web for “Git config alias doesn't work anymore”

    Check what your HOME references:

    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%
    
    Git Baby is a git and github fan, let's start git clone.