当前位置:  开发笔记 > 运维 > 正文

不能在这个盒子上推送到GitHub

如何解决《不能在这个盒子上推送到GitHub》经验,为你挑选了1个好方法。

我在家里克隆了我的GitHub存储库,显然搞砸了.无论如何,我做了很多改动,或者我要删除目录并再次完成所有操作.

首先,当我这样做时,ssh git@github.com我得到以下内容:

PTY allocation request failed on channel 0 ERROR: Hi asdfadfs! You've successfully authenticated, but GitHub does not provide shell access Connection to github.com closed.

我收到错误,但它说我已成功通过验证?

git add .
git commit -a -m "hello"
git push origin master
[master 74a5e82] hello
3 files changed, 45 insertions(+), 12 deletions(-)
fatal: The remote end hung up unexpectedly

这显然不起作用.而且我是git的新手,所以现在当我尝试提交时会发生这种情况:

git add .
git commit -a -m "hello"
git push origin master
# On branch master
nothing to commit (working directory clean)
fatal: The remote end hung up unexpectedly

最后,git pull

$ git pull
You asked me to pull without telling me which branch you
want to merge with, and 'branch.master.merge' in
your configuration file does not tell me either.    Please
specify which branch you want to merge on the command line and
try again (e.g. 'git pull  ').
See git-pull(1) for details.

If you often merge with the same branch, you may want to
configure the following variables in your configuration
file:

branch.master.remote = 
branch.master.merge = 
remote..url = 
remote..fetch = 

See git-config(1) for details.

这是我的.git/config

[core]
        repositoryformatversion = 0
        filemode = true
        bare = false
        logallrefupdates = true
        ignorecase = true
[branch "master"]
[remote "origin"]
        url = git://github.com/my/project.git
        fetch = +refs/heads/*:refs/remotes/origin/*

该url变量实际指向我正确的git url.谢谢.



1> Jed Smith..:

使用ssh://您的的.git/config中,没有git://. git://仅用于克隆存储库.直接从我的libcloud存储库 - 我使用"母舰"的原因与此帖无关:

[remote "mothership"]
    url = ssh://git@github.com/jedsmith/libcloud.git
    fetch = +refs/heads/*:refs/remotes/origin/*

线索应该是你正在使用ssh来测试你的连接......

推荐阅读
依然-狠幸福
这个屌丝很懒,什么也没留下!
DevBox开发工具箱 | 专业的在线开发工具网站    京公网安备 11010802040832号  |  京ICP备19059560号-6
Copyright © 1998 - 2020 DevBox.CN. All Rights Reserved devBox.cn 开发工具箱 版权所有