gitolite gitlist: Failed to resolve HEAD as a vali

2019-05-05 03:38发布

问题:

I've currently switched to gitolite + gitlist on my private server. While gitolite works fine, gitlist and also gitweb don't. While in gitlist i can see the testrepo and my own, gitlist tells me

Oops! fatal: Failed to resolve HEAD as a valid ref.

The config looks valid...

[git]
client = '/usr/bin/git' ; Your git executable path
repositories = '/var/www/gitolite/repositories/' ; Path to your repositories

; You can hide repositories from GitList, just copy this for each repository you want to hide
; hidden[] = '/var/www/projects/BetaTest'
hidden[] = /var/www/gitolite/repositories/gitolite-admin.git

[app]
debug = false

; If you need to specify custom filetypes for certain extensions, do this here
[filetypes]
; extension = type
; dist = xml

... and also the repository

drwxr-xr-x   7 git git 4096 Sep 23 11:53 .
drwxr-xr-x   5 git git 4096 Sep 23 00:19 ..
-rwxr-xr-x   1 git git   23 Sep 23 00:19 HEAD
drwxr-xr-x   2 git git 4096 Sep 23 00:19 branches
-rwxr-xr-x   1 git git   66 Sep 23 00:19 config
-rwxr-xr-x   1 git git  386 Sep 24 17:27 gl-conf
drwxr-xr-x   2 git git 4096 Sep 23 00:19 hooks
drwxr-xr-x   2 git git 4096 Sep 23 00:19 info
drwxr-xr-x 109 git git 4096 Sep 25 00:24 objects
drwxr-xr-x   4 git git 4096 Sep 23 00:19 refs

and the HEAD

cat HEAD
ref: refs/heads/master

Any Idea?

回答1:

Check your tags and branches.

If you have a tag named master, a git clone of the git repo with the -b master option can work too! (-b takes a branch name or a tag)



回答2:

I suffered from this problem, too.

In a bare repository "repoName.git" there is probably this file: -rw-r--r-- 1 git git 23 Sep 19 11:37 HEAD with the content: ref: refs/heads/master. Similar postings suggested to check the access rights for this file.

But when I examined the file repoName.git/refs/heads/master it had these rights -rw------- 1 git git 41 Mar 13 15:22 refs/heads/master.

Therefore I could solve this problem by changing the rights for this file too (actually I granted a little more, you can try to give less rights):

chmod go+r repositories

Where 'repositories' is the repositories directory of gitolite.



标签: git gitolite