我已经安装了 gitolite(现在在本地进行实验),它似乎可以工作,除了新的存储库在 git 克隆后默认不跟踪远程。如果我没记错的话,当我从 github.com 克隆一个存储库时,它已经能够推送和拉取。
这是我尝试过的:
$ git clone git@localhost:sandbox
Cloning into sandbox...
warning: You appear to have cloned an empty repository.
$ echo "A" > README
$ git add README
$ git commit README -m 'test'
$ 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 'git@localhost:sandbox'
当我尝试明确推送时,一切正常:
$ git push origin master
Counting objects: 6, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (6/6), 426 bytes, done.
Total 6 (delta 0), reused 0 (delta 0)
To git@localhost:sandbox
* [new branch] master -> master
真的需要这个额外的步骤吗?可以默认设置吗?在github上,不是吗?
谢谢