3 ms·
┌─────┐◀──────── master │Merge│◀──────── bugfix └▲───▲┘ │ │ │ │ │ ┌─┐ │ │B│ │ └▲┘ ┌─┐ │ │A│ │ └▲┘ │
by stevelosh 10y ago
┌─────┐◀──────── master
│Merge│◀──────── bugfix
└▲───▲┘
│ │
│ │
│ ┌─┐
│ │B│
│ └▲┘
┌─┐ │
│A│ │
└▲┘ │
└───┤
│
┌────────┐
│Ancestor│
└────────┘
Which branch was commit `B` made on? What did the `bugfix` branch look like one commit ago?
- grzm 10y agoNice use of Unicode! Do you have a tool to help you construct a diagram like this?
- deleted 10y ago[deleted]
- sampo 10y agoIf you were in master when you merged bugfix in ("git merge bugfix"), then you can git cat-file -p master and see which commit, A or B, is listed as the first parent. This belongs to the master.
- justinlaster 10y ago> Which branch was commit `B` made on You can do some basic heuristics to figure it out, but I'm not sure what the point of knowing this is. >What did the `bugfix` branch look like one commit ago? `git checkout bugfix; git log bugfix^1`