Listing each branch and its last revision's date in Git

后端 未结 11 748
傲寒
傲寒 2020-11-29 15:07

I need to delete old and unmaintained branches from our remote repository. I\'m trying to find a way with which to list the remote branches by their last modified date, and

11条回答
  •  借酒劲吻你
    2020-11-29 15:50

    Sorted remote branches and the last commit date for each branch.

    for branch in `git branch -r | grep -v HEAD`;do echo -e `git show --format="%ci %cr" $branch | head -n 1` \\t$branch; done | sort -r
    

提交回复
热议问题