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

From David E. Wheeler
Subject Re: Managing multiple branches in git
Date
Msg-id B208DD5A-BEE7-41F0-A4A1-524401BD47DE@kineticode.com
Whole thread Raw
In response to Re: Managing multiple branches in git  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Managing multiple branches in git  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Jun 2, 2009, at 4:13 PM, Tom Lane wrote:

> I think you missed the part of the discussion about not wishing to  
> share
> a single working directory across all the branches.

No, I was just ignoring it for the moment to focus on the commit and  
history issue.

> The time to rebuild
> derived files whenever I switch branches is simply too great with that
> approach.  I want a working copy per branch, and some
> not-impossibly-complicated scheme for managing the pulls/commits/ 
> pushes
> given that environment.

It seems that there are a few approaches, but simplest is probably to  
create a clone of the upstream repository for each branch and work in  
them as if they were separate repositories:

git clone git@git.postgresql.org/postgresql.git master
git clone git@git.postgresql.org/postgresql.git rel8_3
cd rel8_3
git checkout --track -b rel8_3 origin/rel8_3

Then you can make your changes in master and push them back to origin  
when you're done, then backpatch in the rel8_3 checkout and commit  
with the same commit message. The next time you do a `git pull` in  
master, it will also pull down the changes you committed in rel8_3, so  
you'll have a complete history. From there it's just a matter of  
scripting `git log` in a way to make it easy for you to create changes  
files.

Does that make sense?

Best,

David



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Managing multiple branches in git
Next
From: Jeremy Kerr
Date:
Subject: [PATCH v2] Add bit operations util header