检查您是否有 SSH 代理来使用和缓存您的密钥.试试这个: $ ssh -i path/to/public/key [email protected]如果有效,则意味着您的 ssh 客户端没有将您的密钥发送到 GitHub.This question is related to my problem in understanding rebase, branch and merge,and to the problemI found out that other people have had the same problem.The problem seems to be related to /etc/xinet.d/.Problem: unable to push my local branch to my master branch at GithubI rungit push origin masterI get fatal: 'origin' does not appear to be a git repositoryfatal: The remote end hung up unexpectedlyThe error message suggests me that the branch 'origin' is not in my local git repository. This way, Git stops connecting to Github.This is strange, since I have not removed the branch 'origin'.My git tree is dev* master ticgit remotes/Math/Math remotes/Math/master remotes/origin/master remotes/Masi/masterHow can you push your local branch to Github, while you have a teamMate's branch in your local Git?VonC's answer solves the main problem.I put a passphares to my ssh keys.I run $git push github masterI getPermission denied (publickey).fatal: The remote end hung up unexpectedlyIt seems that I need to give the passphrase for Git somehow.How can you make Github ask for your passphrase rather than relying on the ssh key? 解决方案 What does$ git config --get-regexp '^(remote|branch).'returns (executed within your git repository) ?Origin is just a default naming convention for referring to a remote Git repository.If it does not refer to GitHub (but rather a path to your teammate repository, path which may no longer be valid or available), just add another origin, like in this Bloggitation entry$ git remote add origin2 [email protected]:myLogin/myProject.git$ git push origin2 master(I would actually use the name 'github' rather than 'origin' or 'origin2')Check if your gitHub identity is correctly declared in your local Git repository, as mentioned in the GitHub Help guide. (both user.name and github.name -- and github.token)Then, stonean blog suggests (as does Marcio Garcia):$ cd ~/.ssh$ ssh-add id_rsaAral Balkan adds: create a config fileHost github.comUser gitPort 22Hostname github.comIdentityFile ~/.ssh/id_rsaTCPKeepAlive yesIdentitiesOnly yesYou can also post the result ofssh -v [email protected] have more information as to why GitHub ssh connection rejects you.Check also you did enter correctly your public key (it needs to end with '==').Do not paste your private key, but your public one. A public key would look something like:ssh-rsa AAAAB3<big string here>== [email protected](Note: did you use a passphrase for your ssh keys ? It would be easier without a passphrase)Check also the url used when pushing ([email protected]/..., not git://github.com/...)Check that you do have a SSH Agent to use and cache your key.Try this: $ ssh -i path/to/public/key [email protected] that works, then it means your key is not being sent to GitHub by your ssh client. 这篇关于无法将 Git 推送到 Github - 'origin' 似乎不是 git 存储库/权限被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
07-23 14:08