使用Git如何查找本地和远程之间的变化 [英] Using Git how do I find changes between local and remote
问题描述
-
使用Git时,如何查找哪些更改我在本地提交了,但尚未推送到远程分支?我正在寻找类似于Mercurial命令的东西
hg outgoing
。 使用Git时,在我进行拉动之前,我能找到远程分支有哪些变化吗?我在寻找类似于Mercurial命令
hg incoming 的东西。
$ b $第二:有没有办法看看有什么可用的,然后樱桃选择我想要拉的变化?
Git不能通过网络发送这种信息,如Hg可以。但是你可以运行 因此,如果你有一个名为 我的一位朋友David Dollar创建了几个git shell脚本来模拟 Here are two different questions but I think they are related. When using Git, how do I find which changes I have committed locally, but haven't yet pushed to a remote branch? I'm looking for something similar to the Mercurial command When using Git, how do I find what changes a remote branch has prior to doing a pull? I'm looking for something similar to the Mercurial command For the second: is there a way to see what is available and then cherry-pick the changes I want to pull? Git can't send that kind of information over the network, like Hg can. But you can run So, if you have a branch called A friend of mine, David Dollar, has created a couple of git shell scripts to simulate 这篇关于使用Git如何查找本地和远程之间的变化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋! git fetch
(这更像是 hg pull
比 hg fetch <
master的分支,你可以从远程服务器获取新的提交。 c>和一个名为
origin
的远程,在运行 git fetch
之后,还应该有一个名为起源/主
。然后,您可以获得 master
需要成为的超集的所有提交的
通过做 git log
原始/主 git log master..origin / master
。
hg incoming /传出
。你可以在 http://github.com/ddollar/git-utils 找到它们。
hg outgoing
.hg incoming
.git fetch
(which is more like hg pull
than hg fetch
) to fetch new commits from your remote servers.master
and a remote called origin
, after running git fetch
, you should also have a branch called origin/master
. You can then get the git log
of all commits that master
needs to be a superset of origin/master
by doing git log master..origin/master
. Invert those two to get the opposite.hg incoming/outgoing
. You can find them at http://github.com/ddollar/git-utils.