爲什麼我不能推到這個裸存儲庫? - Why can't I push to this bare repository?

問題:

Can you explain what is wrong with this workflow? 你能解釋一下這個工作流程有什麼問題嗎?

$ git init --bare bare
Initialized empty Git repository in /work/fun/git_experiments/bare/
$ git clone bare alice
Cloning into alice...
done.
warning: You appear to have cloned an empty repository.
$ cd alice/
$ touch a
$ git add a
$ git commit -m "Added a"
[master (root-commit) 70d52d4] Added a
 0 files changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 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 '/work/fun/git_experiments/bare'

Doesn't git push always push to the repository I cloned from? git push總是推送到我克隆的存儲庫嗎?


解決方案:

參考一: https://stackoom.com/question/PpuE
參考二: Why can't I push to this bare repository?
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章