Fetch remote log, not the commits

前提是你 提交于 2019-12-22 04:34:07

问题


How can I fetch the remote log without getting the changes/commits ?

I only want to view the log, if there is any new changes since my last pull. Basically avoiding having to stash or commit my changes first.

The git help files have this example, which in inverted form should give the result I want:

git log master --not --remotes=*/master
Shows all commits that are in local master but not in any remote repository master branches

回答1:


You have to fetch the changes, without merging them (i.e. don't use pull):

git fetch origin master

After that you can use log (and other tools) to have a look at the remote's branch:

git log FETCH_HEAD --not master

FETCH_HEAD is an alias to the latest fetched branch, in this case origin/master, just like HEAD is an alias to the latest commit of your currently checked out branch.



来源:https://stackoverflow.com/questions/10736412/fetch-remote-log-not-the-commits

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