Par*_*pta 5 git github git-fetch
我想检查运行 git pull 后将对文件进行的更改。我知道我们用来git fetch从远程存储库检索新对象而不更改本地存储库。但是我如何在编辑器中查看这些更改?
假设所有本地修改均已提交,一种方法是:
git fetch origin
# To see local changes as the "new" version
git diff origin/yourbranch HEAD
# Or to see remote changes as the "new" version
git diff HEAD origin/yourbranch
Run Code Online (Sandbox Code Playgroud)
这会将您的本地存储库(当前HEAD)与远程内容进行比较origin/yourbranch。