Re: Managing multiple branches in git - Mailing list pgsql-hackers

From Ron Mayer
Subject Re: Managing multiple branches in git
Date
Msg-id 4A2689CC.4080900@cheapcomplexdevices.com
Whole thread Raw
In response to Re: Managing multiple branches in git  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Robert Haas wrote:
> The problem with making each release a separate directory is that,
> just like using separate repositories, it will defeat one of the main
> strengths of git, which is the ability to move around commits easily.
> git-new-workdir is the only solution to the problem of having multiple
> branches checked out simultaneously that seems like it might not
> suffer from that weakness.

While I agree "git-new-workdir" is best for typical postgres workflows
so I won't dwell on separate-repositories beyond this post - but I
think you overstate the difficulty a bit.


It seems it's not that hard to cherry-pick from a remote repository by
setting up a temporary tracking branch and (optionally) removing it
when you're done with it if you don't think you'll need it often.

From: http://www.sourcemage.org/Git_Guide
$ git checkout --track -b <tmp local branch> origin/<remote branch>
$ git cherry-pick -x <sha1 refspec of commit from other (local or remote) branch>
$ git push origin <tmp local branch>
$ git branch -D <tmp local branch>

And if you know you'll be moving patches between external repositories
like "origin/<remote branch>" often, ISTM you don't have to do the first and
last steps (which create and remove the tracked branch) each time; but rather
leave the local tracking branch there.



IMVHO, Moving commits around across *different* remote repositories is
also one of the main strengths of moving to a distributed VCS.


pgsql-hackers by date:

Previous
From: "Kevin Grittner"
Date:
Subject: Re: display previous query string of idle-in-transaction
Next
From: Aidan Van Dyk
Date:
Subject: Re: PostgreSQL Developer meeting minutes up