Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
373 views
in Technique[技术] by (71.8m points)

git - 比较Git中的两个分支? [重复](Comparing two branches in Git? [duplicate])

This question already has an answer here:

(这个问题在这里已有答案:)

I have two branches, branch_1 and branch_2 .

(我有两个分支, branch_1branch_2 。)

I want to see the differences between the two branches in Git.

(我想看看Git中两个分支之间的差异。)

  ask by isuruanu translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
git diff branch_1..branch_2

That will produce the diff between the tips of the two branches.

(这将产生两个分支的尖端之间的差异。)

If you'd prefer to find the diff from their common ancestor to test, you can use three dots instead of two:

(如果您希望从他们的共同祖先中找到差异进行测试,您可以使用三个点而不是两个点:)

git diff branch_1...branch_2

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...