user147714
user147714

Reputation: 133

"Not a git repository"

I am trying to use a program that uses git as the backing store (I am new to 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. The repo seems to behave properly when (in the correct directory) I do (for example):

$ git status

What is rev-parse doing and what do I have to do to my repo to make it work?

Upvotes: 10

Views: 30488

Answers (2)

user181548
user181548

Reputation:

Maybe git init is all you need to do.

Upvotes: 6

CB Bailey
CB Bailey

Reputation: 793109

If git status is working then you must be in a non-bare repository with a working tree. git status requires a working tree.

If the program is running git --bare ... then it expects the given directory to be a bare git repository, i.e. with not working directory.

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.

If /home/david/blog.git is actually a non-bare repository then it will have a .git subdirectory. 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. What program is it and what were the instructions for initializing its data store? `

Upvotes: 11

Related Questions