git-sweep

Clean up branches from your Git remotes
Download

git-sweep Ranking & Summary

Advertisement

  • Rating:
  • License:
  • MIT/X Consortium Lic...
  • Price:
  • FREE
  • Publisher Name:
  • Arc90, Inc.
  • Publisher web site:
  • http://arc90.com

git-sweep Tags


git-sweep Description

git-sweep is a command-line tool that helps you clean up Git branches that have been merged into master.One of the best features of Git is cheap branches. There are existing branching models like GitHub Flow and Vincent Driessen's git-flow that describe methods for using this feature.The problemYour master branch is typically where all your code lands. All features branches are meant to be short-lived and merged into master once they are completed.As time marches on, you can build up a long list of branches that are no longer needed. They've been merged into master, what do we do with them now?The answerUsing git-sweep you can safely remove remote branches that have been merged into master.To install it run:pip install git-sweep || easy_install git-sweepTry it for yourself (safely)To see a list of branches that git-sweep detects are merged into your master branch:You need to have your Git repository as your current working directory.$ cd myrepoThe preview command doesn't make any changes to your repo.$ git-sweep previewFetching from the remoteThese branches have been merged into master: branch1 branch2 branch3 branch4 branch5To delete them, run again with `git-sweep cleanup`If you are happy with the list, you can run the command that deletes these branches from the remote, cleanup:$ git-sweep cleanupFetching from the remoteThese branches have been merged into master: branch1 branch2 branch3 branch4 branch5Delete these branches? (y/n) y deleting branch1 (done) deleting branch2 (done) deleting branch3 (done) deleting branch4 (done) deleting branch5 (done)All done!Tell everyone to run `git fetch --prune` to sync with this remote.(you don't have to, yours is synced)Note: this can take a little time, it's talking over the tubes to the remote.You can also give it a different name for your remote and master branches.$ git-sweep preview --master=develop --origin=github...Tell it to skip the git fetch that it does by default.$ git-sweep preview --nofetchThese branches have been merged into master: branch1To delete them, run again with `git-sweep cleanup --nofetch`Make it skip certain branches.$ git-sweep preview --skip=developFetching from the remoteThese branches have been merged into master: important-upgrade upgrade-libs derp-removalTo delete them, run again with `git-sweep cleanup --skip=develop`Once git-sweep finds the branches, you'll be asked to confirm that you wish to delete them.Delete these branches? (y/n)You can use the --force option to bypass this and start deleting immediately.$ git-sweep cleanup --skip=develop --forceFetching from the remoteThese branches have been merged into master: important-upgrade upgrade-libs derp-removal deleting important-upgrade (done) deleting upgrade-libs (done) deleting derp-removal (done)All done!Tell everyone to run `git fetch --prune` to sync with this remote.(you don't have to, yours is synced)Product's homepage


git-sweep Related Software