gitclean

command module
v1.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 1, 2022 License: MIT Imports: 9 Imported by: 0

README

gitclean

Guided Branch Cleanup Utility

Install

go get -u github.com/MCBrandenburg/gitclean

Configuration

You can set standard branches to be ignored using the environment variable GITCLEAN_IGNORE

Example:

GITCLEAN_IGNORE=master,development

Usage

In the root of the project you want to clean, enter this in your prompt: gitclean

Delete Branches

❰~/g/s/g/M/test(OK test3)❱(0)≻ git branch -l
  development
  master
  test1
  test2
* test3
❰~/g/s/g/M/test(OK test3)❱(0)≻ gitclean
GITCLEAN_IGNORE set to 'master,development'
Remove branch test1[y,N,q]? y
Remove branch test2[y,N,q]? n
The following branches will be deleted:
	test1
Continue [y,N]? y
	removing test1
Exiting
❰~/g/s/g/M/test(OK test3)❱(0)≻ git branch -l
  development
  master
  test2
* test3
❰~/g/s/g/M/test(OK test3)❱(0)≻

Quit During Branch Selection

❰~/g/s/g/M/testquit(OK test3)❱(0)≻ git branch -l
  development
  master
  test1
  test2
* test3
❰~/g/s/g/M/testquit(OK test3)❱(0)≻ gitclean
GITCLEAN_IGNORE set to 'master,development'
Remove branch test1[y,N,q]? y
Remove branch test2[y,N,q]? q
Exiting
❰~/g/s/g/M/testquit(OK test3)❱(0)≻ git branch -l
  development
  master
  test1
  test2
* test3
❰~/g/s/g/M/testquit(OK test3)❱(0)≻

Don't Confirm

❰~/g/s/g/M/testno(OK test3)❱(0)≻ git branch -l
  development
  master
  test1
  test2
* test3
❰~/g/s/g/M/testno(OK test3)❱(0)≻ gitclean
GITCLEAN_IGNORE set to 'master,development'
Remove branch test1[y,N,q]? y
Remove branch test2[y,N,q]? y
The following branches will be deleted:
	test1
	test2
Continue [y,N]? n
Exiting
❰~/g/s/g/M/testno(OK test3)❱(0)≻ git branch -l
  development
  master
  test1
  test2
* test3
❰~/g/s/g/M/testno(OK test3)❱(0)≻

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL