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

Creating remote branch called HEAD corrupts remote clones

From
SKStephen Kelly <steveire@gmail.com>
Date
Jan 17, 2011, 10:02 UTC
Message-ID
<ih1449$ul6$1@dough.gmane.org>
Hi,

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. I have not been able to reproduce the exact issue locally, but this script shows that the bob clone behaves oddly on each pull. That is a symptom we saw on Friday. However, bob is still able to push, which we were not able to. That point could be something to do with how the kde git infrastructure is configured.

mkdir remote cd remote/ git init --bare cd ../ git clone remote/ alice cd alice/ echo test >> file git add file git commit -am w git push origin master echo test >> file git commit -am w git branch HEAD git push origin HEAD git push cd .. git clone remote bob cd bob/ git pull --rebase echo test >> file git commit -am w git push git pull git pull git pull

There were also messages like this:
$ git pull
remote: Counting objects: 5, done.
remote: Total 3 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (3/3), done.
From /home/kde-devel/dev/src/playground/git/tmp/remote
 + 1434cd2...dd30974 HEAD       -> origin/HEAD  (forced update)
error: Ref refs/remotes/origin/master is at 
dd3097498a6c1c5bc73ad1f2ff3b7969a6f6d059 but expected 
1434cd2bb9823d2d2b1548c75fdd4ff8b1feddc1
 ! 1434cd2..2fb560d  master     -> origin/master  (unable to update local 
ref)

The HEAD branch was created accidentally and the issue was resolved by doing a git push origin -f :refs/heads/HEAD. Again though, git push -f is not something all developers are allowed to do on the kde git infrastructure, so until that was done, the repo was corrupt for everyone.

Shouldn't git forbit the creation of a branch called HEAD? Hopefully the provided script can lead to the actual issue that caused the corruption of our repo.

Thanks,
Steve.

_______________________________________________ KDE PIM mailing list kde-pim@kde.org https://mail.kde.org/mailman/listinfo/kde-pim KDE PIM home page at http://pim.kde.org/

Next: Stephen Kelly
Message 1 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.