GitHub - stephanel/git-gone

See git gone: cleaning stale local branches.

license

MIT License

Cleaning stale locale branches

  • Store the bash script git-gone where you want (here: C:\users<username>)
  • Edit your .bashrc file and add the path to the PATH variable:
  • Open a Git bash and type the following command to ensure you see the usage instructions:
  • Type the following commands to clean your local branches:
    $ git gone -pn
    $ git gone -d
    $ git gone -D
    $ git branch --merged | grep -v "\*" | grep "wip/\|pr/" | xargs git branch -d