1

I use git bash locally working with multiple remote bare repositories (ssh with public key auth). Every day, I am having to re-install git if I want to work with my remote repositories.

What happens:

When I do git pull, fetch, push, or anything relating to a remote, I get a "fatal: Not a git repository" error. When I uninstall git and reinstall (https://msysgit.github.io/), it works fine until the next time I restart my computer.

What I know:

I know that for some reason, Git bash doesn't like to prompt for passwords. When I have tried working with a remote ssh repository, I get the same "fatal: Not a git repository" error unless I set up public key authentication.

I have never had any issues sshing into the remote server (ssh @).

I spoke to my server provider when I was initially dealing with this issue. The guy I was working with noticed that when I connected using an ssh command (ssh @) he would see a message about a user connecting via OpenSSH. When I would run a git command that used ssh (e.g. git clone ssh://@) he would see that a user tried to connect via PUTTY and that the connection ultimately failed.

My Question:

Has anyone else dealt with this issue? Is there something I can do so I don't have to reinstall git every time I restart my computer?

7
  • What are GIT_SSH and PLINK_PROTOCOL set to in the git bash environment when this works and when it doesn't? Commented Feb 11, 2015 at 17:06
  • I'm confused about how PuTTY fits into this. You use it in your title, you use the putty tag, and you mention that "a user tried to connect via PUTTY". But how are you using it? Are you doing all this from "local" PuTTY shell? Commented Feb 11, 2015 at 17:17
  • @Chris I'm not really sure. I normally use PUTTY for ssh outside of doing git things. It seems to me that git is, for some reason, switching to use PUTTY instead of OpenSSH when running git commands. That is where PUTTY fits into the issue. I'm doing all my commands from local git bash Commented Feb 11, 2015 at 18:14
  • @EtanReisner How do I check what GIT_SSH and PLINK_PROTOCOL are set to? I went into advanced system settings and looked at environment variables, but I see neither of those listed. Commented Feb 11, 2015 at 21:06
  • 1
    @EtanReisner Just restarted, and whaddyano, git is working fine this time. I suppose I will come back and post the variables again when the issue comes up again. I did switch and started using MobaXterm for normal sshing instead of PUTTY, and I have a suspicion that that has resolved the issue. I think that maybe when I open PUTTY, it messes with some settings in GIT, or something along those lines. So, not opening PUTTY maybe results in a resolved issue. Hopefully this stays resolved... Commented Feb 11, 2015 at 21:30

1 Answer 1

2

My solution ended up being to stop using PUTTY at all. I used to use PUTTY for my usual SSH work. It seems that when I would use PUTTY, it would, for some reason, make git use PUTTY for ssh-related git commands.

I ended up switching to MobaXterm, which has a lot of features that I like anyway. I haven't had an issue since I stopped using PUTTY.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.