在git log中仅显示历史合并分支和未合并分支

时间:2019-12-17 15:14:33

标签: git

因此,我的团队正在成长,而我的新同事都集体承诺交付比以前更多的代码。我想要的是一个git log命令,该命令仅显示提交时未合并的分支,但确实显示了我所在分支的完整合并历史记录。

所以,说我使用此命令

git log --all --date=short --graph --pretty=format:"%h%d [%aN] %s" --decorate

看到类似这样的东西

* 0001 (HEAD -> branch-1) [me] ...
| * 0002 (branch-2) [me] ...
|/
| * 0003 (origin/someone-elses-branch, someone-elses-branch) [someone-else] ...
|/
* 0004 (origin/master, master) [someone-else] Merge branch 'another-other-branch'
|\
| * 0005 (origin/another-other-branch) [someone-else] ...
|/
* 0006

我希望能够运行命令以仅查看我未合并的分支,但查看历史记录中其他人的合并分支:

$ git lg-my-branches
* 0001 (HEAD -> branch-1) [me] ...
| * 0002 (branch-2) [me] ...
|/
* 0004 (origin/master, master) [someone-else] Merge branch 'another-other-branch'
|\
| * 0005 (origin/another-other-branch) [someone-else] ...
|/
* 0006

关键是,未合并的seomeone-elses-branch现在不会显示在输出中,而是显示已合并的another-other-branch的历史记录。

有没有办法做到这一点?

0 个答案:

没有答案