git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Best practices for developing multiple related branches simultaneously

From
Wink Saville <wink@saville.com>
Date
Apr 8, 2007, 02:57 UTC
Message-ID
<d4cf37a60704071957r7bb907eg84180097a4594f43@mail.gmail.com>
Hello,

A couple of questions on how to manage a series of hierarchically related branches.

I've created something like this:
----> master
    \----> branchA
         \----> branchB
              \----> branchC

With the intent to be able to create three separate patches that others can make to master and also continue development on all three branches simultaneously.

What I'm doing at the moment is to "git-checkout" one of the three branches A, B or C and make changes. Note; I don't make changes to master as it represents the upstream code and will be pulling from it periodically.

If the branch is a parent to a child and I want the new changes in the parent to be seen by the children I recursively check out the immediate child do a git-rebase.

For example:

*) git-checkout branchA *) change some files on branchA *) git-commit -a *) git-checkout branchB *) git-rebase branchA *) git-checkout branchC *) git-rebase branchB

This seems to work, but is somewhat arduous and I was wondering if there is a better way?

Also, I'd like to checkout and work on all three branches simultaneously. As is implied above, what I do at the moment is use one repository and to switch branches I use git-checkout, so as not to lose work when switching I need to commit before switching. Sometimes I'd rather not commit as I may just want to look at what was in another branch, possibly unrelated to this series. What is a good way of handling this situation?

Regards,
Wink Saville
Next: Junio C Hamano
Message 1 of 3 in “Best practices for developing multiple related branches simultaneously”
  1. Wink SavilleApr 8, 2007
  2. Junio C HamanoApr 8, 2007
  3. Wink SavilleApr 8, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.