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

后端 未结 11 745
傲寒
傲寒 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:51

    Just to add to the comment by @VonC, take your preferred solution and add it to your ~/.gitconfig alias list for convenience:

    [alias]  
        branchdate = !git for-each-ref --sort='-authordate' --format='%(refname)%09%(authordate)' refs/heads | sed -e 's-refs/heads/--'
    

    Then a simple "git branchdate" prints the list for you...

提交回复
热议问题