git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Creating remote branch called HEAD corrupts remote clones

From
Wesley J. Landaker <wjl@icecavern.net>
Date
Jan 20, 2011, 19:21 UTC
Message-ID
<201101201221.00977.wjl@icecavern.net>
In-Reply-To
<AANLkTikvVaSTV8hVjDXLvOEEDv5qr19ybk3Cm--+bgWA@mail.gmail.com>
On Thursday, January 20, 2011 10:32:40 Felipe Contreras wrote:
Show 7 quoted lines
> Hi,
> 
> On Thu, Jan 20, 2011 at 1:14 PM, Stephen Kelly <steveire@gmail.com> wrote:
> > Stephen Kelly wrote:
> >> 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.
Previous: Felipe ContrerasNext: Junio C Hamano
Message 8 of 40 in “Creating remote branch called HEAD corrupts remote clones”
  1. Stephen KellyJan 17, 2011
  2. Stephen KellyJan 20, 2011
  3. Thomas RastJan 20, 2011
  4. Stephen KellyJan 20, 2011
  5. Erik Faye-LundJan 20, 2011
  6. Stephen KellyJan 20, 2011
  7. Felipe ContrerasJan 20, 2011
  8. Wesley J. LandakerJan 20, 2011
  9. Junio C HamanoJan 20, 2011
  10. Jeff KingJan 20, 2011
  11. Junio C HamanoJan 20, 2011
  12. Jeff KingJan 20, 2011
  13. Felipe ContrerasJan 20, 2011
  14. Junio C HamanoJan 21, 2011
  15. Felipe ContrerasJan 22, 2011
  16. Stephen KellyFeb 20, 2011
  17. Stephen KellyApr 26, 2011
  18. Felipe ContrerasApr 26, 2011
  19. Stephen KellyApr 27, 2011
  20. Felipe ContrerasApr 27, 2011
  21. Stephen KellyApr 27, 2011
  22. Felipe ContrerasApr 27, 2011
  23. Stephen KellyApr 27, 2011
  24. Felipe ContrerasApr 27, 2011
  25. Erik Faye-LundApr 27, 2011
  26. Erik Faye-LundApr 27, 2011
  27. Stephen KellyMay 2, 2011
  28. Erik Faye-LundMay 2, 2011
  29. Felipe ContrerasMay 3, 2011
  30. Stephen KellyMay 3, 2011
  31. Felipe ContrerasMay 3, 2011
  32. Erik Faye-LundMay 4, 2011
  33. only warn about ambiguous refs if stderr is a ttyErik Faye-Lund, May 9, 2011
  34. Jeff KingMay 9, 2011
  35. Erik Faye-LundMay 9, 2011
  36. Jeff KingMay 9, 2011
  37. Erik Faye-LundMay 9, 2011
  38. Jeff KingMay 9, 2011
  39. Junio C HamanoMay 9, 2011
  40. Jeff KingMay 9, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.