如何在git中列出本地提交差异
我在本地克隆了一个远程存储库,随着时间的推移,我已将本地提交添加到该克隆的存储库中。
现在,每当我执行 git status
操作时,我都会看到 Yourbranch is before 'origin/master' by xx commits 消息。
问:如何仅列出本地提交,以便我可以更详细地检查这些提交,并最终将其中一些合并到上游?
I have a remote repository cloned locally, and over time, I have added local commits to that cloned repository.
Now, whenever I do git status
, I see Your branch is ahead of 'origin/master' by xx commits message.
Q: How do I list only commits made locally, so that I can examine these commits into more detail, and eventually merge some of them into upstream?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以通过指定
log
命令的范围来完成此操作:当然,使用您的分支名称而不是 master。
您可以在这里阅读更多信息,例如: double 之间有什么区别Git 提交范围中的 - 点“..”和三点“...”?
另外,请阅读
man gitrevisions
。You can do it by specifying the range to the
log
command:Use your branch name instead of master, of course.
You can read more for example here: What are the differences between double-dot ".." and triple-dot "..." in Git commit ranges?
Also, read
man gitrevisions
.