Let's say I have a feature branch called feat
which got merged into the master
branch:
master feat
| .
(1) .
|\ .
| \ .
| \ .
| \ .
| \. <-- create branch `feat` from `master`
| |
| |
| (2) <-- make a commit on `feat`
| /
| /
| /
| /
|/
(3) <-- merge `feat` into `master`
|
How can I tell from the merge commit (3) what the source branch for that commit was (feat
)?
I found that you can get a list of branch names given a commit hash by running git branch --contains <commit>
, but then I'm still left with the problem that I don't know the commit hash of the last commit of the source branch (2).
Edit:
No, Finding what branch a Git commit came from doesn't answer my question. Please read the last paragraph of this question.