tags:

views:

581

answers:

2

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?

A: 

Maybe "git init" is all you need to do.

Kinopiko
Try `git init --bare` instead. As the other answer points out, what he needs is just the `.git` directory and not a working directory to go with it.
Daniel Spiewak
Thanks - I edited the question so that it is apparent that I did that.
+4  A: 

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? `

Charles Bailey
Thanks - that's cleared things up a lot. Now, how do I make `refs/heads/index`? (I can see only `master` in the `refs/heads` directory). The program is "tekuti" (http://wingolog.org/software/tekuti/) and it recommends to migrate the store from wordpress (which I have not used, so don't have).
Are you sure that you *need* to make a branch called `index`? Might tekuti be checking whether the branch exists so that it can make it with it own content? (If you do need to make it `git branch index` should work.)
Charles Bailey
Spot on! (Perhaps the easiest path is to use Wordpress after all...)