Thread (8 messages) flat view 8 messages, 5 authors, 2016-06-15

Re: Creating remote branch called HEAD corrupts remote clones

From: Wesley J. Landaker <hidden>
Date: 2016-06-15 22:50:26

On Thursday, January 20, 2011 10:32:40 Felipe Contreras wrote:
Hi,

On Thu, Jan 20, 2011 at 1:14 PM, Stephen Kelly [off-list ref] wrote:
quoted
Stephen Kelly wrote:
quoted
On Friday we had an issue where a developer pushed a branch called
HEAD to the remote server. The result was that other developers could
not pull or push.
[...]
 Which version of git?
 Which kind of network transport was used?
 Is this reproducible?
FWIW, here is a quick demonstration of at least one problem with having a 
branch called HEAD. You can make it and push it fine, but when cloning, you
don't get it.

#!/bin/bash
git init --bare origin.git
git clone origin.git wc1
cd wc1
git commit --allow-empty -m "Initial rev"
git checkout -b HEAD
git commit --allow-empty -m "Make HEAD branch"
git push --all
cd ..
git clone origin.git wc2
diff -u <(cd wc1; git branch -a) <(cd wc2; git branch -a)
diff -u <(cd wc1; git log --all) <(cd wc2; git log --all)

If I do the following from wc2 I can get the branch manually:

git pull origin refs/heads/HEAD:HEAD

I haven't played with it enough to see what other problems might arise.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help