Delete old branches in #git
▻https://hackernoon.com/delete-old-branches-in-git-ab1ec5049dd9?source=rss----3a8144eabfe3---4
Sometimes there are many branches, accumulated over the years in a git repository. And you need to delete it to save some space or make management of your repository easy.To get the list of all local branches╭─asit@gandua ~/stringify ‹master*›╰─$ git branch ci-build-script dev* master remotes/origin/add-license-1 remotes/origin/benchmarkAfter that, you can iterate over all local branches and get some technical details like branch creation date(age of the branch), last commit date, last commit message etc.I will try to delete ci-build-script.╭─asit@gandua ~/stringify ‹master*›╰─$ git merge-base ci-build-script master e3b47d97284b911baa266853b208f5ea25115e67git merge-base tries to find out a good common ancestor. This can be assumed to return the earliest commit id where branch (...)
#old-branches-in-git #branches-in-git #how-to-delete-branches #delete-old-branches