Git: Is there a way to figure out where a commit was cherry-pick'ed from?

前端 未结 3 1203
独厮守ぢ
独厮守ぢ 2020-11-29 02:54

If I cherry-pick from multiple branches, is there a simple way to figure out where the commit was coming from (e.g. the sha of the original commit)?

Example:
- a

3条回答
  •  无人及你
    2020-11-29 03:34

    No information about the original commit is embedded in the newly created commit, so there's no direct way to tell. What you suggest (searching for the commit message) is probably the best way - it's certainly a lot easier than searching for a commit with the same diff:

    git log --grep="" --all
    

    Unless of course the commit's no longer reachable from a branch... probably then you'd want to look at the output of git fsck.

提交回复
热议问题