问题
i would like to know which files would be updated (and hopefully the changes that would occur) if i'd do a 'git pull'...
is
git stash
git fetch
git diff origin/master
git stash apply
the answer ?
回答1:
See here. To quote:
you can do a 'git fetch origin', then a 'git log master..origin/master', and it'll tell you what changes will be merged if you do a 'git merge origin/master'.
回答2:
Since git pull
is git fetch
plus git merge
, do the fetch
first, and then diff the remote branch against your current branch (git diff origin/whatever..
).
回答3:
is
git stash git fetch git diff origin/master git stash apply
the answer ?
Yes.
来源:https://stackoverflow.com/questions/2284931/is-there-a-simple-way-to-know-which-files-will-be-updated-in-the-next-git-pull