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

Re: keeping remote branches in sync

From
Shawn O. Pearce <spearce@spearce.org>
Date
Oct 9, 2008, 15:46 UTC
Message-ID
<20081009154637.GV8203@spearce.org>
In-Reply-To
<20081009153738.GJ18241@morganstanley.com>
Kevin Green <Kevin.T.Green@morganstanley.com> wrote:
Show 11 quoted lines
> On 10/09/08 11:16:36, Shawn O. Pearce wrote:
> > I keep meaning to add "git remote prune" logic into "git fetch",
> > e.g. as a "git fetch --prune" option.  fetch has all of the data
> > it needs to implement the prune already in memory, it just doesn't
> > have the loop to do the prune cleanup.
> > 
> > Now that "git remote" is in C it should be easy to share the prune
> > code between them, and make this more automatic.
> 
> That would be great...  And a config option to have it done by default each
> time so '$ git-pull' will just do what we want for our origin remote?

Right. I think most users would want to set that config option. git-gui has a config option to enable this prune after fetch behavior, but its basically just calling "git remote prune" when fetch is done running.

I think can also work around it with an alias:
	git config --alias fp \
	'! git fetch "$0" "$@" && git remote prune "$0"'

Not bullet proof but it should do the prune for you after it does the fetch, assuming you fetched from an existing remote and not a random URL.

-- 
Shawn.
Previous: Kevin Green
Message 5 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.