开发者

Git command to see if repository has changed (no diff)

开发者 https://www.devze.com 2023-01-29 02:18 出处:网络
say I clone a git repo locally... time goes by and I want to see if anything has changed back at the origin... but i don\'t, necessarily, want to fetch or pull...yet.

say I clone a git repo locally... time goes by and I want to see if anything has changed back at the origin... but i don't, necessarily, want to fetch or pull...yet.

what's the command for seeing a list of commits SINCE i last pulled...or just the fact that there HAVE be开发者_如何学运维en some commits since I last pulled?

i don't want overhead of diff in this case...


git remote show origin


Try:

git fetch --dry-run


You need to at least fetch, without that the repo will have no information about the remote repository. git diff --summary will then show you a short summary of the changes.


get all of the commits into local tracking branch:
git fetch

list all of the changes between tracking branch and HEAD:
git log origin/master HEAD

0

精彩评论

暂无评论...
验证码 换一张
取 消