也许是一个重复的问题,虽然我试图从现有问题中找到答案,但失败了。
我在服务器上创建了一个 Git repo 命令 :
mkdir gitrepo
cd gitrepo
git init
然后从另一台机器上 我试图将文件推到回购中,但失败了
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
以前有没有遇到过这个问题?
I found an blog which explains well the difference between non-bare and bare repo. http://www.bitflop.com/document/111 Those who gets the same problem may refer to this.