Re: Re: Pull is Evil
- From
W. Trevor King <wking@tremily.us>
- Date
- May 1, 2014, 17:56 UTC
- Message-ID
- <20140501175623.GY6227@odin.tremily.us>
- In-Reply-To
- <5362664C.8040907@xiplink.com>
On Thu, May 01, 2014 at 11:20:44AM -0400, Marc Branchaud wrote:
Show 16 quoted lines
> On 14-05-01 05:46 AM, brian m. carlson wrote: > > git checkout maintenance-branch > > # Update our maintenance branch to the latest from the main repo. > > git pull --ff-only > > git pull --no-ff developer-remote topic-branch > > git push main-repo HEAD > > … > What's more, it seems to me that the only real advantage "git pull" provides > here is a less typing compared to the non-pull equivalent: > > git fetch main-repo > git checkout main-repo/maintenance-branch > git fetch developer-remote > git merge --no-ff developer-remote/topic-branch > git push main-repo HEAD
You're missing Brian's fast-forward merge here. It should be:
git checkout maintenance-branch git fetch main-repo git merge --ff-only main-repo/maintenance-branch git fetch developer-remote …
> Sure, the non-pull approach makes use of Scary Branch Stuff (remotes > and namespaces and detached HEADs -- oh my!).
No need for detached heads with Brian's local maintenance-branch. If you're teaching and just need folks merging the remote's HEAD, you can avoid namespaces and remotes entirely:
git fetch git://example.net/main-repo.git git merge --ff-only FETCH_HEAD
although I doubt “the remote's HEAD” will be easier to explain than the namespaced, remote-tracking branches it replaces. It's certainly not worth the hassle of un-training FETCH_HEAD-merges later on ;).
Cheers, Trevor
-- This email may be signed or encrypted with GnuPG (http://www.gnupg.org). For more information, see http://en.wikipedia.org/wiki/Pretty_Good_Privacy