[英]“Not a git repository”
I am trying to use a program that uses git as the backing store (I am new to git). 我正在尝试使用一个使用git作为后备存储的程序(我是git的新手)。 On initialization, this program does a: 在初始化时,该程序执行以下操作:
"git" "--bare" "rev-parse" "refs/heads/index"
Which results in: 结果如下:
fatal: Not a git repository: '/home/david/blog.git'
I followed this tutorial , git init
, git add test.txt
and git commit
. 我按照本教程 , git init
, git add test.txt
和git commit
。 The repo seems to behave properly when (in the correct directory) I do (for example): 当我(在正确的目录中)(例如)时,repo似乎表现得正常:
$ git status
What is rev-parse
doing and what do I have to do to my repo to make it work? 什么是rev-parse
正在做什么以及我必须对我的回购做些什么才能使它工作?
If git status
is working then you must be in a non-bare repository with a working tree. 如果git status
正在运行,那么您必须位于具有工作树的非裸存储库中。 git status
requires a working tree. git status
需要一个工作树。
If the program is running git --bare ...
then it expects the given directory to be a bare git repository, ie with not working directory. 如果程序正在运行git --bare ...
那么它希望给定的目录是一个简单的git存储库,即没有工作目录。
The naming convention of reponame.git
is usually reserved for bare repositores and non-bare repositories usually use a directory name of reponame
and contain a .git
subdirectory. reponame.git
的命名约定通常保留用于裸存储库,而非裸存储库通常使用reponame
的目录名并包含.git
子目录。
If /home/david/blog.git
is actually a non-bare repository then it will have a .git
subdirectory. 如果/home/david/blog.git
实际上是非裸存储库,则它将具有.git
子目录。 If this is the case you can probably point the program at /home/david/blog.git/.git
but I can't help feeling that it would be safer to point it at a truly bare repository. 如果是这种情况,您可以将程序指向/home/david/blog.git/.git
但我不禁觉得将它指向真正的裸存储库更安全。 What program is it and what were the instructions for initializing its data store? 它是什么程序以及初始化其数据存储的说明是什么? ` `
也许“git init”就是你需要做的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.