How can I diff two branches in GitHub?

£可爱£侵袭症+ 提交于 2019-11-27 01:43:53

问题


I am just wondering if there is a way to simply diff two branches in GitHub? I know GitHub has capacity to do it because when we do code-reviews it does list out all the diffs nicely. I was just wondering if there is a way to do it without any code review to compare say Branch to Branch or Commit to Commit? So that when I push something to my remote branch and I want to see how my diffs are going to look like BEFORE it create a PR then it can be very helpful.

I can always be in console and do git diff but that is really not as nice and visually clear as how it shows up in web UI of GitHub. Any ideas?


回答1:


Use the compare feature to accomplish this.




回答2:


If you are on any branch other than master you should see a link to compare:

Click it and you should get redirected to the compare-tool where you can select branches or commits to compare



来源:https://stackoverflow.com/questions/43552274/how-can-i-diff-two-branches-in-github

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