简体   繁体   中英

Git Bash - Putty - Not a git repo issue - Windows

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 (eg 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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM