gpt4 book ai didi

Git 错误 : src refspec master does not match any

转载 作者:IT王子 更新时间:2023-10-29 01:15:03 27 4
gpt4 key购买 nike

<分区>

我需要创建一个名为 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 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

这是我的问题:

我尝试从我的本地机器 check out /克隆新的存储库

$ 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 在本地机器上不显示任何东西

服务器上的 /srv/gitosis/repositories/carboncake.git/refs/heads/ 目录也是空的。

我该如何解决这个问题?

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com