git:列出远程更改 [英] git: list remote changes

查看:178
本文介绍了git:列出远程更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个git远程我的(恰好是github fork),已经成功通过2次提交。我的本地主分支领先244个提交(从原始gitub回购)。因此,推到我的并不是快进。



如何列出我的提前2个提交?

解决方案

你的问题有点不清楚,但它听起来像你想要在远程分支上列出不提交的提交存在于您当地的分支机构中。使用提交范围 ..

 #从远端
获取最近的更新git fetch< remote>

#列出所有在< remote> /< branch>但不在您的本地<分行>
git log --oneline< branch> ..< remote> /< branch>



文档



官方Linux内核 git log


 <自> ..< until> 

仅显示指定的两个提交之间的提交。当省略<自> <直到> 时,它默认为HEAD,即当前分支。有关如何拼写<自> <直到> 的更完整列表,请参阅 gitrevisions(7) blockquote>

另请参阅




I have a git remote "mine" (happens to be a github fork) that has managed to get ahead by 2 commits. My local master branch is ahead of it by 244 commits (pulled from the original gitub repo). As a result, pushing to "mine" is not fast-forward.

How can I list the 2 commits by which "mine" is ahead?

解决方案

Your question is a little unclear, but it sounds like you want to list the commits on the remote branch that don't exist in your local branch yet. This is simply accomplished using a commit range ..:

# Get the most recent updates from the remote
git fetch <remote>

# List all commits that are in <remote>/<branch> but not in your local <branch>
git log --oneline <branch>..<remote>/<branch>

Documentation

From the official Linux Kernel git log documentation:

<since>..<until>

Show only commits between the named two commits. When either <since> or <until> is omitted, it defaults to HEAD, i.e. the tip of the current branch. For a more complete list of ways to spell <since> and <until>, see gitrevisions(7).

See Also

这篇关于git:列出远程更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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