简体   繁体   中英

How to get list of branches “merged” to git tag

We are tagging master with release number. I want to get list of branches that were merged to master branch before a specific release tag was created.

I could do it by hand calling git tag --contains last_commit_of_each_branch but I'm lazy.

Is there a better way to do it? Or should I just script getting all branches and calling contains for last commits in each of those?

First , find the branches which were merged into master by git branch --merged master . Assume the branches merged into master are branch1 , branch2 ,…, branchn .

Second , check if a branch or some branches added tags on the last commit of each branch.

Check if branchx added tag on the last commit: git tag --contains branchx .

Check if branchm and branchn added tags on the last commits: git tag --contains branchm --contains branchn .

Of cause, you can use script to achieve it and it's more time saving.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM