gpt4 book ai didi

git - 如何确定git中的最后一个 merge 分支?

转载 作者:行者123 更新时间:2023-11-29 09:36:23 25 4
gpt4 key购买 nike

我需要确定最后一个 merge 到 master 的分支。

我一直在搜索 git 文档,但我还是有点迷茫。到目前为止我已经找到了命令(假设 master 是我当前的分支)

git log --oneline --graph --decorate

这为我提供了这样的输出

git log --oneline --graph --decorate
* 12cfc6d (HEAD, origin/master, origin/HEAD, master) Merge branch 'release/VCS_6.12.0-20150826' to master
|\
| * bef8908 (origin/release/VCS_6.12.0-20150826) Merge remote-tracking branch 'origin/release/VCS_6.12.0-20150826' into release/VCS_6.12.0-20150826
| |\
| | * c61f97b Merge pull request #12 in COM/vcs from feature/SWAT-47-Loader-JMS to release/VCS_6.12.0-20150826
| | |\
| | | * 33aefe6 (origin/feature/SWAT-47-Loader-JMS) [SWAT-47] Merge from release/VCS_6.12.0-20150826 branch
| | | |\
| | | |/
| | |/|
| | * | 8f452b0 Revert pom.xml and fix formatting.
| | * | 128b347 Modified pom.xml by git hook. Command was mvn ci-versions:reset -DforceVersion=feature/VCS-4590_Migrate_translation_util_features
| | * | eaa9065 VCS-4590 - Migrate dev.vcs translation util to VCS production
| | | * 6fe1adc [SWAT-47] Move jmsProductUpdateListener bean to publishState-common-meta and properties config to appconfig.
| | | * ec8311f [SWAT-47] Revert the change of skipping role check for local testing
| | | * e545332 [SWAT-47] Fix checkstyle issues
| | | * 0df27b4 Merge remote-tracking branch 'origin/feature/SWAT-47-Loader-JMS' into feature/SWAT-47-Loader-JMS
| | | |\
| | | | * cb87d1b Play with JMS
| | | * | 5f55b97 [SWAT-47] Added jmsProductUpdateListener to publish JMS message to jmsProductUpdate topic instead of jmsCacheReset topic.
| | | * | 09f1bc9 [SWAT-47] Play with JMS
| | | |/

在那里你可以看到最后 merge 的分支是“origin/release/VCS_6.12.0-20150826”。

是否有更简单的方法来使用一个(或多个)bash 命令来确定这一点?

最佳答案

git log --first-parent --merges -1 --oneline

应该这样做。

关于git - 如何确定git中的最后一个 merge 分支?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32322990/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com