[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Git/Magit: To which branch was a commit was originally committed?
From: |
Daniel Fleischer |
Subject: |
Re: Git/Magit: To which branch was a commit was originally committed? |
Date: |
Mon, 01 Nov 2021 18:09:05 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.60 (darwin) |
Upon thinking, one cannot answer the question you're asking. This is
because commits do not hold this information; they don't "remember" in
which branch they were. Git history is a graph where commits are nodes.
Branches are labels we stick to specific nodes. When we update, we move
a label forward to another node. That previous node does not "remember"
that a label was used to be attached to it. The answer I gave you a
minute ago only answers the following question: if I start from a given
commit/node and go forward in time, which branches/labels would I meet?
it answers your question only in the simplest cases (no splits) but
hopefully that is what you're looking for.
Best,
--
Daniel Fleischer