Git doesn't change working directory

I’m using Windows 10. Before I install git, I have installed git 1.9.5.github.0 (by installing GitHub Desktop), it works just fine.
But when I installed git (from, I’m not able to use git anymore:

After that, I returned to the old version of git – git 1.9.5.github.0, but the fault still there.

I think git didn’t change its working directory, I have no idea.
Now, I’m not able to work with git.

How to fix this?


Again, this is not the first time I use git, I never forget cd myproject. However, although I moved to the project, git “thought” itself working in C:\Program Files\Git and doesn’t “realize” that the working directory has been changed! That’s the problem, As the title: Git doesn’t change working directory


When Get-Command git in powershell, it returns:

CommandType      Name         Version      Source
-----------      ----         -------      ------
Application      git.exe      C:\Program Files\Git\cmd\git.exe


@EdwardThomson asked me for output of git config --list and Get-ChildItem Env:

  • Output of git config --list:

  • Output of Get-ChildItem Env:


I have received an email which mentions GIT_DIR, then I know what exactly caused my problem! It’s because of environment variable GIT_DIR, I set GIT_DIR to the folder which contains git for convenience without aware that git uses it

Thank you for trying to help me.

  • Cloning git repository from Windows with CopSSH and MSysGit
  • How to exclude file only from root folder in Git
  • git: where do the conflict commits go when rebasing
  • How to overcome going futher down in git Bash
  • How to rename files in git that are being worked on by other people without losing history?
  • SVN trunk overwritten by old release. Project and trunk folder have now different histories
  • One Solution collect form web for “Git doesn't change working directory”

    you must be inside a folder having .git directory (hidden).

    Git Baby is a git and github fan, let's start git clone.