Re: [Q] Branch aliases (synonyms)?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 3 Jul 2012 18:22:43 +0200, Johan Herland <johan@xxxxxxxxxxx> wrote:
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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]