So I've created a repo using Git Bash, and it works (Local and Remote repo on github.com). I've pushed README file for testing, and it worked. In my config everything seems okay:
[core]
repositoryformatversion = 0
filemode = false
bare = false
logallrefupdates = true
symlinks = false
ignorecase = true
hideDotFiles = dotGitOnly
[gui]
pruneduringfetch = true
encoding =
[remote "origin"]
url = git@github.com:SOME_USERNAME/some-project-name.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master
And $ ssh -V git@github.com
gives:
Hi SOME_USERNAME! You've successfully authenticated, but GitHub does not provide shell access.
And I'm able to push files and everything, but only through Git Bash. However, I've tried to work with and it gave me the following error:
The remote end hung up unexpectedly
When I manually changed the "origin" url to this:
https://SOME_USERNAME@github.com/SOME_USERNAME/some-project.git
It worked. So it doesn't work with "git@..." but do work with "https://..". I've tried another program - SmartGit. It also gives me
The remote end hung up unexpectedly
but when I try to do this "change url trick" in SmartGit, for "https://..." it gives me the following error:
Push: Authentication failed
Authentication failed Setting remote
Setting remote service path not supported by protocol.
I'm completely lost with all this stuff. What am I doing wrong?
尝试以管理员身份运行SmartGit。
SSH will look for keys in %HOME%/.ssh
, which (" HOME
") isn't always defined (msysgit will define it by default, maybe TortoiseGit but you can specify your ssh keys , probably not SmartGit )
So make sure HOME is set to %userprofile%
, before launching SmartGit.
The fact that it doesn't work with the "git@" url but works with the "https" shows that this is to do with your SSH key setup. Make sure you had chosen the "OpenSSH" option ( and not PUTTY) for TortoiseGit and in the settings page for TortoiseGit verify that the "Remote" section points to the place where your keys are placed.
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.