find out which git commit a file was taken from

前端 未结 2 923
夕颜
夕颜 2021-02-20 08:41

A collaborator that does not use version control has sent me a file with some local modifications. Now he went on vacation. I would like to find out which version his edits were

2条回答
  •  孤街浪徒
    2021-02-20 09:32

    I'd create a new branch with the colleague's change and then use git merge-base:

    git merge-base finds best common ancestor(s) between two commits to use in a three-way merge. One common ancestor is better than another common ancestor if the latter is an ancestor of the former. A common ancestor that does not have any better common ancestor is a best common ancestor, i.e. a merge base. Note that there can be more than one merge base for a pair of commits.

提交回复
热议问题