How to see what will be merged after git fetch

末鹿安然 提交于 2019-12-11 10:42:00

问题


My question is after doing a git fetch how can I see what is what git actually fetched from origin? I have my guesses by using diff but I don't know exactly how I can do it.


回答1:


Due to the fact that after a git fetch the fetched references are in origin/master (just an example, if you have more branches then they are updated as well as origin/<name> and you can apply the following commands as well) you have several options here:

1. Display file names only that have been changed

git diff --name-only origin/master

2. Display file status only

git diff --name-status origin/master

3. Really show what changed

 git diff origin/master

Or you use git show for this task: git show --oneline --name-only master..origin/master

And for completeness you can use the following command to count commits that where fetched.

git rev-list --count HEAD..origin/master


来源:https://stackoverflow.com/questions/31443255/how-to-see-what-will-be-merged-after-git-fetch

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