我需要创建一个名为carboncake的回购。
我试了一下:
将gitosis-admin存储库克隆到本地机器
$ git clone gitosis@myserver.net: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密钥文件(我使用Git basg for Windows):
一些地方/ mithun cp美元。keydir - mithun酒吧。酒吧
执行如下命令:
$ git add gitosis.conf keydir/mithun.pub
$ git commit -m "Added 'carboncake' repository and 'mithun' user."
$ git pull --rebase
$ git push
但它不会产生任何碳饼。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 gitosis@myserver.net: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 'gitosis@myserver.net:repositories/carboncake.git'
当我尝试git push origin HEAD:master时,它返回错误:
error: src refspec HEAD does not match any.
fatal: The remote end hung up unexpectedly
error: failed to push some refs to 'gitosis@myserver.net:repositories/carboncake.git'
当我尝试git push origin master:refs/heads/master时,它返回错误:
error: src refspec master does not match any.
fatal: The remote end hung up unexpectedly
error: failed to push some refs to 'gitosis@myserver.net:repositories/carboncake.git'
Git show-ref在本地机器上不显示任何东西
也/电脑/ gitosis /仓库/ carboncake。服务器上的Git /refs/heads/目录为空。
我该如何解决这个问题?