1.0.5-beta.1 • Published 4 years ago

@duylam/git-gc v1.0.5-beta.1

Weekly downloads
7
License
MIT
Repository
github
Last release
4 years ago

git-gc

git-gc was renamed to git-branch-clean. Please visit and use git-branch-clean package instead

npm

A command line tool to clean up unused git branches

Table of content

1. Usage

  1. Install nodejs. The minimum version supported is v8.x or newer
  2. Install the command line tool
npm i -g @duylam/git-gc
  1. cd to a git folder
  2. To remove unused branches at
  • local branches
    git-gc
  • remote repo with name origin
    git-gc -r origin
  1. Above command prints branches that will be removed, and asks for confirmation. Below is how it looks like
$ git-gc
Switching to branch 'master'
Following local branches will be deleted:
  sample-branch-1
  sample-branch-2
  sample-branch-3
Type 'y' to delete above branch or any key for canceling, then hit Enter: y
Finished!
  1. Finished! Your git folder (or remote git repo) is clean now. See more options with git-gc -h

2. Contribution

2.1. Setup

2.2. Getting started

  1. Run npm install to install dependencies.
  2. Run npm start to begin watching file changes and auto build to build folder.
  3. Alter $PATH for launching build/index.js: PATH=$PATH:/this-folder/build
  4. Move to another git folder (e.g cd /some/git/folder) and run the tool: DEBUG=git-gc index.js --help
  5. Begin coding, Pull Requests are welcome :)

2.3. Other development commands

  • npm run format to format the code nicer
  • npm run lint to run static code checker
  • npm run update-toc to update the Table of Content in this file
  • To create dummy local and remote (name "origin") git branches for coding, run the script ./scripts/create-dummy-branches.sh at any git folder