Re: [git] Re: Pull is Evil

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

 



On Thu, May 01, 2014 at 11:20:44AM -0400, Marc Branchaud wrote:
> 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

Attachment: signature.asc
Description: OpenPGP digital signature


[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]