Fetch remote log, not the commits

2019-04-24 12:38发布

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条回答
萌系小妹纸
2楼-- · 2019-04-24 12:57

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.

查看更多
登录 后发表回答