Chr*_*her 17
"远程分支"只不过是提交指针和附属包数据.只是git fetch <remote>如果你想查看遥控器和本地文件之间的差异,你可以这样做:
git diff <local_branch> <remote>/<remote_branch> -- <file>
Run Code Online (Sandbox Code Playgroud)
例如,在许多情况下这将是git diff master origin/master -- <file>.您还可以看到提交差异git log:
git log <local_branch>..<remote>/<remote_branch> -- <file>
Run Code Online (Sandbox Code Playgroud)
所以... git log master..origin/master -- <file>
最后,如果您只想从远程检出特定版本的文件(这可能不太理想;将远程分支与git merge <remote>/<remote_branch>or 合并要好得多git pull),请使用:
git checkout <remote>/<remote_branch> -- <file>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
15205 次 |
| 最近记录: |