How to compare/diff specific version of master and fork repo in github

Deadly 提交于 2019-12-01 09:36:27
VonC

I try to fork more than one Fork form the same root/master

You don't have to fork more than one repo: fork only the repo you intent to contribute to (through PR - Pull Request). Here, fork Repo1, then clone it locally.

On your local clone, type:

git remote add /url/repo2
git fetch repo2

Then you can diff between master and repo2/master.

git diff repo2/master..master

See more at "Showing which files have changed between git branches"

git diff --name-status repo2/master..master

The OP qtime67 adds in the comments:

as Repo1 has moved on greatly since Repo2 was forked, I wish to first see only the core changes made between the original Fork (Repo2) and the version of Repo1 at the time the fork was made.

As described in "Git diff .. ? What's the difference between having .. and no dots", that would be using three dots:

git diff repo2/master...master
git diff master...repo2/master

A three dots diff will diff from the common ancestor (git merge-base foo master)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!