/rmvcsdir

remove version control directories

Primary LanguageGoOtherNOASSERTION

rmvcsdir - remove version control directories

This utility takes in one or more paths and recursively walks their complete directory trees deleting Git, Bzr, SVN, and Mercurial directories along the way.

Build Status Build status Go Report Card

Warning: This is a destructive operation where you likely cannot recover the files afterwards. Do this at your own risk.

Options/Flags

  • -dryrun: Display locations to delete without deleting them.
  • -quiet: Do not display output unless an error occurs.
  • -skip-check: Skip checking if locations exist.

Examples:

Deleting files from a single directory:

$ rmvcsdir ./vendor
Deleting: /Users/mfarina/Code/go/src/github.com/Masterminds/glide/vendor/github.com/Masterminds/semver/.git
Deleting: /Users/mfarina/Code/go/src/github.com/Masterminds/glide/vendor/github.com/Masterminds/vcs/.git
Deleting: /Users/mfarina/Code/go/src/github.com/Masterminds/glide/vendor/github.com/codegangsta/cli/.git
Deleting: /Users/mfarina/Code/go/src/github.com/Masterminds/glide/vendor/gopkg.in/yaml.v2/.git

Deleting files from multiple directories:

$ rmvcsdir ~/Code/myproj ~/Code/myproj2/vendor
...

Perform a dry run where files are not deleted but you can see what would be deleted:

$ rmvcsdir -dryrun ./vendor
Deleting: /Users/mfarina/Code/go/src/github.com/Masterminds/glide/vendor/github.com/Masterminds/semver/.git
Deleting: /Users/mfarina/Code/go/src/github.com/Masterminds/glide/vendor/github.com/Masterminds/vcs/.git
Deleting: /Users/mfarina/Code/go/src/github.com/Masterminds/glide/vendor/github.com/codegangsta/cli/.git
Deleting: /Users/mfarina/Code/go/src/github.com/Masterminds/glide/vendor/gopkg.in/yaml.v2/.git