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

Re: [PATCH] Introduce git-mirror, a tool for exactly mirroring another repository.

From
Jakub Narebski <jnareb@gmail.com>
Date
Nov 1, 2006, 12:23 UTC
Message-ID
<eia3jk$n2f$1@sea.gmane.org>
In-Reply-To
<20061101151859.0e984d3f.vsu@altlinux.ru>
Sergey Vlasov wrote:
Show 7 quoted lines
>> Perhaps just don't remove log when branch is deleted. I tend for example
>> to be careful when reordering commits on a branch, and use git branch -f
>> instead of deleting and recreating branch to not lose reflog.
> 
> Keeping the reflog does not help - reflog entries are not refs, and do
> not keep the referenced objects live in the repository.  Therefore old
> objects will be lost when the repository is repacked and pruned.

Well, now to reorder and choose which commits on branch to save, and optionally also rebase, I use $ git branch tmp $ git branch -f <branch> <upstream> $ git checkout <branch> $ git cherry-pick tmp~<n> ... $ git branch -D tmp

> Also, the reflog really must be deleted together with the ref itself -
> otherwise it may cause a file/directory conflict when another ref is
> created.  Of course, if the ref is renamed instead of deleting, the
> corresponding reflog may be renamed too.

There is currently no command to rename branch (and rename reflog). It would be nice if git-branch could also rename branch (and reflog).

-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
Previous: Sergey VlasovNext: Junio C Hamano
Message 9 of 10 in “Introduce git-mirror, a tool for exactly mirroring another repository.”
  1. Introduce git-mirror, a tool for exactly mirroring another repository.Shawn Pearce, Sep 25, 2006
  2. Junio C HamanoSep 26, 2006
  3. Shawn PearceSep 26, 2006
  4. Sergey VlasovOct 31, 2006
  5. Shawn PearceOct 31, 2006
  6. Junio C HamanoNov 1, 2006
  7. Jakub NarebskiNov 1, 2006
  8. Sergey VlasovNov 1, 2006
  9. Jakub NarebskiNov 1, 2006
  10. Junio C HamanoNov 1, 2006

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.