How does 'git merge' work in details?

后端 未结 5 1503
夕颜
夕颜 2020-11-28 02:45

I want to know an exact algorithm (or near that) behind \'git merge\'. The answers at least to these sub-questions will be helpful:

  • How does git detect the con
5条回答
  •  广开言路
    2020-11-28 03:31

    Here is the original implementation

    http://git.kaarsemaker.net/git/blob/857f26d2f41e16170e48076758d974820af685ff/git-merge-recursive.py

    Basically you create a list of common ancestors for two commits and then recursively merge them, either fast forwarding them, or creating virtual commits that get used for the basis of a three-way merge on the files.

提交回复
热议问题