比较本地git分支与远程分支? [英] compare local git branch with remote branch?

查看:852
本文介绍了比较本地git分支与远程分支?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在本地分支和远程分支之间看到 diff

How can I see the diff between a local branch and a remote branch?

推荐答案

要更新远程跟踪分支,您需要首先键入 git fetch 然后:

To update remote-tracking branches, you need to type git fetch first and then :

git diff <masterbranch_path> <remotebranch_path>

您可以将 git branch -a 列表所有分支机构(本地和远程)然后从列表中选择分支名称(只需从远程分支名称中删除远程/

You can git branch -a to list all branches (local and remote) then choose branch name from list (just remove remotes/ from remote branch name.

例子: git diff master master / master (其中master是本地主分支,origin / master是远程即原始分支和主分支)。

Example: git diff master origin/master (where "master" is local master branch and "origin/master" is a remote namely origin and master branch.)

这篇关于比较本地git分支与远程分支?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆