我需要創建一個名爲carboncake
的回購。Git錯誤:src refspec master不匹配任何
我嘗試這樣:
克隆Gitosis的管理員信息庫,以我的本地機器
$ git clone [email protected]:repositories/gitosis-admin.git
$ cd gitosis-admin
$ vim gitosis.conf
添加了[repo carboncake]
和[group carboncake]
部分文件
[gitosis]
[group team]
writable = sweepshots
members = git_id_rsa
[group gitosis-admin]
writable = gitosis-admin
members = git_id_rsa
[repo carboncake]
description = A brand new app by Mithun.
owner = Mithun P
[group carboncake]
writable = myappname
members = mithun @core
結束然後複製Putty生成的pub key文件(我使用Git basg for Windows):
$cp /some/where/mithun.pub keydir/mithun.pub
執行以下命令:
$ git add gitosis.conf keydir/mithun.pub
$ git commit -m "Added 'carboncake' repository and 'mithun' user."
$ git pull --rebase
$ git push
但它不創建我的服務器任何carboncake.git。
所以我也跟着這樣:
執行的服務器上運行以下命令:
$ su gitosis
$ git init --bare /srv/gitosis/repositories/carboncake.git
這裏是我的問題:
我試圖檢出從/克隆新的存儲庫我的本地機器
$ mkdir carboncake
$ cd carboncake
$ git init
$ touch a_text_file.txt
$ git add a_text_file.txt
$ git remote add origin [email protected]:repositories/carboncake.git
$ git push origin master
其中返回的錯誤:
error: src refspec master does not match any.
fatal: The remote end hung up unexpectedly
error: failed to push some refs to '[email protected]:repositories/carboncake.git'
當我試圖git push origin HEAD:master
它返回的錯誤:當我試圖git push origin master:refs/heads/master
它返回的錯誤
error: src refspec HEAD does not match any.
fatal: The remote end hung up unexpectedly
error: failed to push some refs to '[email protected]:repositories/carboncake.git'
:在
error: src refspec master does not match any.
fatal: The remote end hung up unexpectedly
error: failed to push some refs to '[email protected]:repositories/carboncake.git'
git show-ref
本地機器不顯示任何東西
另外/srv/gitosis/repositories/carboncake.git/refs/heads/
服務器上的目錄爲空。
我該如何解決這個問題?
@Danny [在幾個月內第一次創建了一個新的存儲庫...](https://www.youtube.com/watch?v=t2F1rFmyQmY) – Droogans 2013-05-12 22:12:00
'git'有一些糟糕的錯誤消息。 – 2014-03-04 03:43:35
絕對正確,它只是發生在我身上的同一個錯誤消息,並意識到我還沒有登臺和提交。 這意味着我剛剛upvoted這個,一個。不幸的是, – blakroku 2015-03-30 10:40:51