How can I compare my local forked repository with changes that may have been made to the original?

帅比萌擦擦* 提交于 2019-12-04 02:11:03

Before one can run a git diff between one's own local repo and the upstream, one must first fetch the upstream repo. The comparison is then made locally.

git fetch upstream

This does not affect the working branch of your repo but it does add a whole other bunch of "remote" branches, which you can see with git branch -a.

Once you've got those, use:

git diff master upstream/master

This will compare the local repository you have with any updates that have been made to the original repository. Variations on this command will deal with updates you may have made to your own branch or check against a common ancestor (e.g., git diff master...upstream/master) as usual.

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