Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
589 views
in Technique[技术] by (71.8m points)

heroku - My Git installation always refers to the wrong directory. Why?

I installed and re-installed Git on my Windows8 machine multiple times. It's a long story as to why I did that. Once I installed it at C:Git and now I have it installed at C:Program Files (x86)Git and now I am having Git configuration problems. My Git configuration is unable to write security credentials to Git configuration files because it thinks they are in a location that no longer exists (C:Git).

Because of this, I always resort to using the GitHub GUI, but that wont work with Heroku. So now I need help.

For example, when trying to push code to Heroku I get:

C:IntelliJ IDEA 12.1.4workspacesignup-sheet>git remote -v
heroku  [email protected]:signup-sheet.git (fetch)
heroku  [email protected]:signup-sheet.git (push)
origin  https://github.com/djangofan/signup-sheet.git (fetch)
origin  https://github.com/djangofan/signup-sheet.git (push)
C:IntelliJ IDEA 12.1.4workspacesignup-sheet>git push heroku master
Could not create directory '/c/Git/.ssh'.
The authenticity of host 'heroku.com (__.__.__.156)' can't be established.
RSA key fingerprint is 8b:48:5e:00:0e:00:16:00:32:00:87:0c:00:c8:60:ad.
Are you sure you want to continue connecting (yes/no)? yes
Failed to add the host to the list of known hosts (/c/Git/.ssh/known_hosts).
Permission denied (publickey).
fatal: Could not read from remote repository.

Also,

C:IntelliJ IDEA 12.1.4workspacesignup-sheet>git config --global user.email "[email protected]"
error: could not lock config file C:Git/.gitconfig: No such file or directory
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

This is linked to the value of the environment variable HOME.

With the old msysgit, that git-cmd.bat contains:

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

With the new git-for-windows, the git.exe is build with:

--cd-to-home"; WorkingDir: %HOMEDRIVE%%HOMEPATH%

In both cases, HOME is set to, by default, %HOMEDRIVE%%HOMEPATH%.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...