Git doesn't change working directory
I’m using Windows 10. Before I install
git 2.6.1.windows.1, I have installed
git 1.9.5.github.0 (by installing GitHub Desktop), it works just fine.
But when I installed
git 2.6.1.windows.1 (from git-scm.com), I’m not able to use git anymore:
The powershell console displayed
[master], even when I changed working directory to my project, it still display
git push), It told me an error:
fatal: Not a git repository: 'C:\Program Files\Git'
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
Get-Command git in powershell, it returns:
CommandType Name Version Source ----------- ---- ------- ------ Application git.exe 220.127.116.11 C:\Program Files\Git\cmd\git.exe
@EdwardThomson asked me for output of
git config --list and
git config --list: http://pastebin.com/qUxKnBiT
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.
One Solution collect form web for “Git doesn't change working directory”
you must be inside a folder having .git directory (hidden).