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

Deleting remote branches with git-branch and reflog questions

From
APAndy Parkins <andyparkins@gmail.com>
Date
Jan 23, 2007, 12:59 UTC
Message-ID
<200701231259.27719.andyparkins@gmail.com>
Hello,
As per subject.

If anything, these are safer to delete than local branches because they will be restored automatically with the next fetch, so why do we require the extra switch for remote branches?

Would it be simpler for the user if the following worked?
$ git branch -a
* master
  origin/master
$ git branch -D origin/master
i.e. that the -r switch was unnecessary in unambiguous cases.

reflogs -------

Why does the reflog directory .git/logs need to store the refs/ directory? Aren't /all/ the refs under "refs/" these days?

Is it right that the reflog for a branch is deleted when the branch is 
deleted?  Doesn't this kill one of the advantages of reflogs?  In particular, 
if I accidentally deleted a branch, I would have no way of getting it back 
because the reflog has been deleted too?  Personally I'd prefer that a reflog 
line was added saying
  XXXXXXXXXXXXXXX 00000000000000 Deleted
Or similar.  After all; it's only disk space.  If the ref was later created 
again, then the log can continue to be added to, but it will have a "Created 
from" in the middle instead of at the end.
Andy
-- 
Dr Andy Parkins, M Eng (hons), MIEE
andyparkins@gmail.com
Next: Andreas Ericsson
Message 1 of 16 in “Deleting remote branches with git-branch and reflog questions”
  1. Andy ParkinsJan 23, 2007
  2. Andreas EricssonJan 23, 2007
  3. Andy ParkinsJan 23, 2007
  4. Junio C HamanoJan 23, 2007
  5. Johannes SchindelinJan 23, 2007
  6. Nicolas PitreJan 23, 2007
  7. Johannes SchindelinJan 23, 2007
  8. Junio C HamanoJan 24, 2007
  9. Nicolas PitreJan 24, 2007
  10. Jakub NarebskiJan 24, 2007
  11. Nicolas PitreJan 24, 2007
  12. Johannes SchindelinJan 24, 2007
  13. Jakub NarebskiJan 23, 2007
  14. Andy ParkinsJan 23, 2007
  15. Johannes SchindelinJan 23, 2007
  16. Andy ParkinsJan 23, 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.