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

[PATCH 0/4] push: add 'prune' option

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
Feb 22, 2012, 22:43 UTC
Message-ID
<1329950621-21165-1-git-send-email-felipe.contreras@gmail.com>
Hi,

As mentioned in a previous thread[1], git is lacking some functionality to synchronize completely with remote repositories.

As an example I put my use-case; I want to backup *all* my local branches to a personal repository, and I want to remove branches that I have removed from my local repository. git push personal 'refs/heads/*' mostly does the job, but it doesn't remove anything, and that's where 'prune' comes from.

Do not confuse the remote branches with the upstream ones; you could have two repositories where you want to synchronize branches to: % git push --prune --force backup1 'refs/heads/*' % git push --prune --force backup2 'refs/heads/*'

I still think a 'git remote sync' would be tremendously useful, but it can actually use this --prune option.

Cheers.
[1] http://article.gmane.org/gmane.comp.version-control.git/184990
Since RFC:
 - Most of comments addressed
 - Documentation and tests added
Felipe Contreras (4):
  remote: use a local variable in match_push_refs()
  remote: reorganize check_pattern_match()
  remote: refactor code into alloc_delete_ref()
  push: add 'prune' option
 Documentation/git-push.txt |    9 +++-
 builtin/push.c             |    2 +
 remote.c                   |  107 ++++++++++++++++++++++++++++----------------
 remote.h                   |    3 +-
 t/t5516-fetch-push.sh      |   16 +++++++
 transport.c                |    2 +
 transport.h                |    1 +
 7 files changed, 100 insertions(+), 40 deletions(-)
-- 
1.7.9.1
Next: Felipe Contreras
Message 1 of 9 in “push: add 'prune' option”
  1. 0/4 push: add 'prune' optionFelipe Contreras, Feb 22, 2012
  2. 1/4 remote: use a local variable in match_push_refs()Felipe Contreras, Feb 22, 2012
  3. 2/4 remote: reorganize check_pattern_match()Felipe Contreras, Feb 22, 2012
  4. 3/4 remote: refactor code into alloc_delete_ref()Felipe Contreras, Feb 22, 2012
  5. 4/4 push: add 'prune' optionFelipe Contreras, Feb 22, 2012
  6. Junio C HamanoFeb 23, 2012
  7. Felipe ContrerasFeb 23, 2012
  8. Junio C HamanoFeb 23, 2012
  9. Felipe ContrerasFeb 23, 2012

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.