2015-09-01 85 views
1

我需要確定哪個是最後一個分支合併到主。如何確定git中的最後一個合併分支?

我一直在尋找git文檔,但我仍然有點失落。到目前爲止,我已經找到了命令(假設主是我當前的分支)

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 
| | | |/ 

輸出在那裏,你可以看到,最後一個分支合併爲「原產地/釋放/VCS_6.12.0-20150826" 。

是否有一個簡單的方法來確定這與一個(或幾個)bash命令?

回答

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

應該這樣做。