我如何运行git log来查看仅针对特定分支的更改? [英] How do I run git log to see changes only for a specific branch?

查看:1322
本文介绍了我如何运行git log来查看仅针对特定分支的更改?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个本地分支跟踪远程/主分支。运行 git-pull git-log 后,日志将显示远程跟踪分支中的所有提交以及当前分支。但是,因为对远程分支做了很多更改,所以我只需要看到对当前分支进行的提交。



Git命令是什么用于仅显示特定分支的提交?



注释:

配置信息:

  [branchmy-branch] 
remote = origin
merge = refs / heads / master


解决方案

假设您的分支创建于 master

  git cherry -v master 

  git log master .. 

如果您的分支是由 origin / master 制成的,则说 origin / master 而不是 master


I have a local branch tracking the remote/master branch. After running git-pull and git-log, the log will show all commits in the remote tracking branch as well as the current branch. However, because there were so many changes made to the remote branch, I need to see just the commits made to the current local branch.

What would be the Git command to use to only show commits for a specific branch?

Notes:

Configuration information:

[branch "my-branch"]
  remote = origin
  merge = refs/heads/master

解决方案

Assuming that your branch was created off of master:

git cherry -v master

or

git log master..

If your branch was made off of origin/master, then say origin/master instead of master.

这篇关于我如何运行git log来查看仅针对特定分支的更改?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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