How do I get the list of branches not merged into master, ordered by most recent commit?

后端 未结 3 1756
轻奢々
轻奢々 2021-01-04 18:18

For our buildbot, I want to display the most recently-updated active (non-released) branches. Let\'s say I have a master branch, as well as the following, from

3条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-04 18:50

    Can't you just grep out branch2?

    Basically, something like:

    for branch in `git branch -r --no-merged origin/master`; do git for-each-ref --sort=-committerdate --format='%(committerdate:short) %(refname:short)' --count=15 refs/remotes/origin/ | grep $branch; done;
    

    That worked for me given your sample output.

提交回复
热议问题