【发布时间】:2012-05-24 15:16:15
【问题描述】:
也许是一个重复的问题,虽然我试图从现有问题中找出答案但失败了。
我使用命令在服务器上创建了一个 git repo:
mkdir gitrepo
cd gitrepo
git init
然后我尝试从另一台机器将文件推送到这个 repo 但失败了。
git init
git clone user@server:~/gitrepo/.git
cd gitrepo
touch test
git add test
git commit -a
到目前为止,没有发生错误。当我尝试将更改推送到服务器时,出现以下错误:
>git push
No refs in common and none specified; doing nothing.
Perhaps you should specify a branch such as 'master'.
fatal: The remote end hung up unexpectedly
error: failed to push some refs to 'user@server:~/gitrepo/.git'
以前有人遇到过这个问题吗?
我发现一个博客很好地解释了非裸仓库和裸仓库之间的区别。 http://www.bitflop.com/document/111 遇到同样问题的可以参考这里。
【问题讨论】:
-
也许你应该指定一个分支,比如'master'。
-
我试过这个“git push master”,得到“致命:'master'似乎不是 git 存储库。致命:远程端意外挂断”。当前我在 master 分支上