我在家里克隆了我的GitHub存储库,显然搞砸了什么。无论如何,我做了很多更改,否则我会清除目录并重新做一遍。
首先,当我执行
最后,
这是我的.git/config文件。
首先,当我执行
ssh git@github.com
时,我得到以下内容:
PTY分配请求在通道0上失败
错误:您已成功验证,但GitHub不提供Shell访问
与github.com的连接已关闭。
我收到一个错误提示,但它说我已经成功验证?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 <repository> <refspec>').
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 = <nickname>
branch.master.merge = <remote-ref>
remote.<nickname>.url = <url>
remote.<nickname>.fetch = <refspec>
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。谢谢。
~/.gitconfig
文件中:https://gist.github.com/412f0b1c8841cceed750 - sarahhodne