A housekeeping utility to clean up your git repository
Keeping your git repository clean can be a pain, especially when working with large teams and large codebases. Are you lost in the giant pile of outdated branches of remote? Tired of asking all your team members to clear their unused branches? Git Housekeeper is here to help!
This utility helps you review all the branches on remote, and remove any unused branches if necessary.
In order to easily generate Google Sheets, git-housekeeper hosts an API that calls the Google API with the meta information of the branches in your repository. If you would rather not share repository information with our API, you have the option to use to the Google API directly. Follow these instructions if you want to use the Google API directly.
KEEP
or DELETE
DELETE
, and (after yourIf you would rather not use Google Sheets and review the remote branches by yourself, you can run in interactive mode. Select "ask me which branches I would like to keep" from the menu.
Sometimes a local branch is tracking a branch on remote, but the remote branch is already gone. This can often happen when the branch is finished on another machine, or if the branch has been merged using a web interface. This utility lists all those branches, and if needed cleans them all up in one batch!
npm install -g git-housekeeper
It is recommended to install the git-housekeeper package globally, so you can run it from any directory. However, you can also include it as a dev-dependency in your project.
To use the source code instead of installing from NPM:
npm run build
node main.js <args>
instead of git-housekeeper <args>
Run one of the commands listed below. Then follow the on-screen instructions
git-housekeeper [options] <path>
run git-housekeeper on the given repositorygit-housekeeper process-sheet [options] <path>
process a Google Sheet previously created with git-housekeeperpath
[string] the path to the repository to analyse, relative to the current working directory.-d, --dry-run
Executes a dry run (won't remove any branches) defaults to false
--version
Show version number--help
Show helpWhen trying to connect to an https
git remote, Git Housekeeper should automatically prompt you to enter a username and password.
If your remote is setup using ssh
instead, you need to run an SSH agent in the background with valid keys.
On Windows, pageant can be used as an SSH agent.