git clone --bare: 致命:存储库不存在
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/19155097/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
git clone --bare: fatal: repository does not exist
提问by BonifatiusK
I am using git version 1.7.10.4 on debian Wheezy.
我在 debian Wheezy 上使用 git 版本 1.7.10.4。
I am trying to create a new repository (according to the 'manual of git-scm.com) However everytime I get this fatal error:
我正在尝试创建一个新的存储库(根据git-scm.com的“手册” )但是每次我遇到这个致命错误时:
fatal: repository 'poekoe' does not exist
So this is what I type at command line:
所以这就是我在命令行输入的内容:
git clone --bare --progress poekoe poekoe.git
I also tried this on a sqeeze distribution and there it works fine. (git version on squeeze is: git version 1.7.2.5)
我也在一个 sqeeze 发行版上尝试过这个,它工作正常。(关于squeeze的git版本是:git version 1.7.2.5)
All installed packages on the wheezy distribution are:
wheezy 发行版上所有已安装的软件包是:
libcurl4-gnutls-dev
libexpat1-dev
gettext
vim
libz-dev
libssl-dev
git
all to get this working.
一切都是为了让这个工作。
Does anybody know how to fix this? I am running the script as root
有谁知道如何解决这个问题?我以 root 身份运行脚本
采纳答案by VonC
git clone --bare --progress poekoe poekoe.git
That git clone
only works if your current directory does contain the repo poekoe
.
也就是说git clone
,如果您的当前目录中确实含有回购仅适用poekoe
。
If your current folder is empty, then the error message makes sense.
如果您的当前文件夹为空,则错误消息是有道理的。
The URLs sectionrecommends using absolute paths:
该网址部分建议使用绝对路径:
$ git clone --bare -l /home/proj/.git /pub/scm/proj.git
The OP Bonifatiuskreports in the commentsa solution depending on git version:
该OP Bonifatiusk报告的意见的解决方案取决于Git版本:
I found this:
git --bare init poekoe.git
: this is indeed different from older versions who will init a new repo using--bare
with clone.
我找到了这个:
git --bare init poekoe.git
:这确实与旧版本不同,旧版本将使用--bare
与克隆一起初始化新的存储库。
回答by xameeramir
Sharing for future readers...
分享给未来的读者...
One possibility can be access rights. Make sure that you have at leastread access to your main repository which you're trying to interact with.
一种可能性是访问权限。确保您至少具有对您尝试与之交互的主存储库的读取访问权限。
On web based git solutions such as Bucketand Hub, this issue is unlikely since access permissions is handled by them in many cases.
在基于 Web 的 git 解决方案(例如Bucket和Hub )上,此问题不太可能发生,因为在许多情况下访问权限是由它们处理的。
回答by P.Mahendra
you get this error(fatal: repository 'pekoe' does not exist) when you don't follow the steps properly in git.
当您没有在 git 中正确遵循这些步骤时,您会收到此错误(致命:存储库“pekoe”不存在)。
step-1:: install git and config with command
步骤 1:: 使用命令安装 git 和 config
git config --global user.name eg., mack09 git config --global email
git config --global user.name 例如,mack09 git config --global email
step-2:: the go to Github website create a new repository
step-3:: copy the address from right-hand side https://github.com/mack09/repo.git
step-2:: 到 Github 网站创建一个新的仓库 step-3:: 从右侧复制地址 https://github.com/mack09/repo.git
step-4:: go to git bash or cmd , create a folder to store all your project
do go to the folder you created and now you are in created folder.
step-5:: do this
git clone https://github.com/mack09/repo.gitstep-6:: add heart.txt and git commit-m " message"
and git push origin master.
I tried this step it worked so try it and reply whatever the result.
步骤 4:: 转到 git bash 或 cmd ,创建一个文件夹来存储您的所有项目,然后转到您创建的文件夹,现在您在创建的文件夹中。步骤 5:: 执行此操作 git clone https://github.com/mack09/repo.git步骤 6:: 添加 heart.txtgit commit-m " message"
和 git push origin master。我试过这一步,它奏效了,所以试试吧,无论结果如何,都可以回复。