git-push on packed refs via HTTP
Hi
Using HTTP as transport, I've noticed that after using git-gc on a git server, I can't push to that repo anymore: "No refs in common and none specified." Client and server are both 1.6.2. Is ths a bug or do I have to do something after executing git-gc on the server?
Thanks! Steve
Hi Steve,
Quoted 4 lines · On Friday, 20. March 2009 10:50:57 you wrote:
Using HTTP as transport, I've noticed that after using git-gc on a git server, I can't push to that repo anymore: "No refs in common and none specified." Client and server are both 1.6.2. Is ths a bug or do I have to do something after executing git-gc on the server?
Check the permissions of the files on the server, I once accidentally executed git commands as root user and the HTTP server was later
unable to read/write the repository properly.
Thomas
Quoted 3 lines · Thomas Jarosch <thomas.jarosch <at> intra2net.com> writes:
Check the permissions of the files on the server, I once accidentally executed git commands as root user and the HTTP server was later
unable to read/write the repository properly.
The perms are okay, yet the error message remains.
Quoted 7 lines · Steve
Hi
Using HTTP as transport, I've noticed that after using git-gc on a git server, I can't push to that repo anymore: "No refs in common and none specified." Client and server are both 1.6.2. Is ths a bug or do I have to do something after executing git-gc on the server?
I had this happen once after having upgraded git on the server in question and then running "git gc" against a repo. I didn't remove the old (not packed-refs knowing) git though, and when I later tried to push to it, it couldn't find any refs since the old receive-pack was being used, and it didn't know about packed refs.
Worth checking, possibly.
Signature · 7 lines
Andreas Ericsson [email protected] OP5 AB www.op5.se Tel: +46 8-230225 Fax: +46 8-230231 Considering the successes of the wars on alcohol, poverty, drugs and terror, I think we should give some serious thought to declaring war on peace.
Quoted 5 lines
I had this happen once after having upgraded git on the server in question and then running "git gc" against a repo. I didn't remove the old (not packed-refs knowing) git though, and when I later tried to push to it, it couldn't find any refs since the old receive-pack was being used, and it didn't know about packed refs.
Which file/contents do I have to look for or remove in order to kick the old not packed refs?
Hi,
Quoted 4 lines · Steve
Using HTTP as transport, I've noticed that after using git-gc on a git server, I can't push to that repo anymore: "No refs in common and none specified." Client and server are both 1.6.2. Is ths a bug or do I have to do something after executing git-gc on the server?
could you try running git update-server-info?
Signature · 2 lines
Cheers, Ray Chuan
Quoted 1 line
could you try running git update-server-info?
Forgot to mention that: I have tried git update-server-info, yet no luck.
Hi,
Quoted 4 lines · Steve
Quoted 1 line
could you try running git update-server-info?
Forgot to mention that: I have tried git update-server-info, yet no luck.
Actually, you have to undo the ref-packing performed by gc. You can do it this way (quick and dirty):
$ git show-ref | while read sha1 name do mkdir -p .git/$(dirname $name) && echo $sha1 > .git/$name done
Hth,
Dscho
Hi Dscho
Thanks for your snippet, that did the trick. I only had to alter it slightly because the repo on the server is bare:
git show-ref |
while read sha1 name
do
mkdir -p $(dirname $name) &&
echo $sha1 > $name
done
Just for understanding: Why is this step necessary? Does it have anything to do with serving the repo over HTTP at all?
Cheers, Steve