Git development
 help / color / mirror / Atom feed
* How does git track history overwrites?
@ 2026-05-24 23:41 Jens Tröger
  2026-05-25  3:46 ` Chris Torek
  2026-05-25  6:51 ` Junio C Hamano
  0 siblings, 2 replies; 3+ messages in thread
From: Jens Tröger @ 2026-05-24 23:41 UTC (permalink / raw)
  To: git

Hello,

I’m looking for details and some clarification on a `git fetch` behavior I observed, but can’t quite explain. More context is in this Github comment:

  https://github.com/jenstroeger/python-package-template/pull/1190#discussion_r3288253713

but it boils down to this:

  /tmp/bla > git -c protocol.version=2 fetch origin dda8db18cfc68df532abf33b185ecd12d5b7b326 --depth=1

It seems that sha dda8db1 (tag 1.20.0 previously pointed at it) was replaced due to a suspected history overwrite with fda7769 (tag 1.20.0 now points at it) and git figures that out:

  ...

  From https://github.com/adamchainz/blacken-docs
  * branch dda8db18cfc68df532abf33b185ecd12d5b7b326 -> FETCH_HEAD

And then:

  /tmp/bla > git checkout FETCH_HEAD
  Note: switching to 'FETCH_HEAD’

  ...

  HEAD is now at fda7769 Version 1.20.0

And:

  /tmp/bla > cat .git/HEAD 
  fda77690955e9b63c6687d8806bafd56a526e45f
  /tmp/bla > cat .git/FETCH_HEAD 
  dda8db18cfc68df532abf33b185ecd12d5b7b326 'dda8db18cfc68df532abf33b185ecd12d5b7b326' of https://github.com/adamchainz/blacken-docs

I’d like to understand the details some more, and how I could manually make that connection?

Thank you!
Jens


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-05-25  6:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-24 23:41 How does git track history overwrites? Jens Tröger
2026-05-25  3:46 ` Chris Torek
2026-05-25  6:51 ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox