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

Re: [Q] Branch aliases (synonyms)?

From
HFHallvard Breien Furuseth <h.b.furuseth@usit.uio.no>
Date
Jul 3, 2012, 17:49 UTC
Message-ID
<93495bc04d9f7426bef1b1de1b202280@ulrik.uio.no>
In-Reply-To
<CALKQrgeAXLSwsqwTe_FZN0aNHwnoSBHBt+PO9jpCtzRM1Aeyrw@mail.gmail.com>
 On Tue, 3 Jul 2012 18:22:43 +0200, Johan Herland <johan@herland.net> 
 wrote:
Show 9 quoted lines
> FWIW, we have done a similar thing at $dayjob: A git repo (originally
> converted form Subversion) still used "trunk" as the main development
> branch. We wanted to start following Git conventions, so we renamed 
> it
> to "master", and set up "trunk" as a symref to "master". We then told
> all the other developers that "trunk" is now "master", and that they
> should switch at their own leisure. After a grace period, we will
> remove the "trunk" symref.
> (...)
 Yes, a symref in the master repo only seems tidy enough.
 I should have realized that's what he meant.
 I can think of one irritant to warn developers of:
 git fetch           # Fetches both A and B
 git checkout A      # Lemme see how this looks for A users...
 ...
 git checkout B      # My scripts are still using B though...
 ...commit something...
 git push            # Pushes B, doesn't know remote A is forwarded
 git push            # Rejected, non-fast-forward of your old A
 "WTF, why does that keep happening all the time?"
 git branch -d A     # Fixes the above (if A is not checked out:)
 And if you haven't already, it may be best to do
 git config --bool receive.denyNonFastForwards  true
 git config --bool receive.denyDeletes          true
 just in case someone gets too clever and does something like:
 "Now how do I get rid of the remote A?  Google... Aha"
 git push origin :refs/heads/A  # whoops, wrong A deleted:-)
 Hallvard
Previous: Johan HerlandNext: Brian Foster
Message 9 of 11 in “[Q] Branch aliases (synonyms)?”
  1. Brian FosterJul 3, 2012
  2. Hallvard Breien FurusethJul 3, 2012
  3. Hallvard Breien FurusethJul 3, 2012
  4. Brian FosterJul 3, 2012
  5. Michael HaggertyJul 3, 2012
  6. Brian FosterJul 4, 2012
  7. Brian FosterJul 5, 2012
  8. Johan HerlandJul 3, 2012
  9. Hallvard Breien FurusethJul 3, 2012
  10. Brian FosterJul 4, 2012
  11. Hallvard Breien FurusethJul 4, 2012

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.