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

keeping remote branches in sync

From
KGKevin Green <kevin.t.green@morganstanley.com>
Date
Oct 9, 2008, 14:14 UTC
Message-ID
<20081009141418.GF18241@morganstanley.com>
Hi,

We've been using git for our development for a few months now. We've got two developers and each push up to a shared bare repository. Our workflow is pretty simple and goes something like this:

We do development in local topic branches. Occasionally, when we want the other to take a look we might push them up to our shared repo.

Once we're happy with local testing and code review, we rename the topic branch to prefix it with "$user/for_next/". This lets us know that the developer feels the code is ready for more further integration testing. We use a branch called 'next' which merges all the for_next branches together. One of us merges all the for_next branches locally and pushes it up to the shared repo. We then have some jobs that release that branch as an alpha nightly build for further testing by more users.

After topic branches are merged to master, we do some cleanup by deleting them from the shared repo.

One of the issues we have is that _my_ local repos remote branches aren't kept in sync with the shared repo. So, if the other developer deletes all his topic branches and I do a git-pull, the topic branches still show as remotes in my branch and vice versa for him. This is exactly what we expect, but it's not desirable for us.

I'd like some comment on whether our workflow could use some improvement. Specifically, if there's a straightforward way to handle the issue above, that would be great. I've been looking through the manual on git-fetch and git-pull and not seeing any options to do this.

I was thinking of writing a little utility that does a 'git-cherry master $topic' and doing a 'git-branch -d -r $topic' on any topic branch that is already in master, but I'd rather use something already there, if possible.

What are others doing to handle this situation?
Thanks!
--Kevin
Next: Peter Harris
Message 1 of 5 in “keeping remote branches in sync”
  1. Kevin GreenOct 9, 2008
  2. Peter HarrisOct 9, 2008
  3. Shawn O. PearceOct 9, 2008
  4. Kevin GreenOct 9, 2008
  5. Shawn O. PearceOct 9, 2008

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.