Skip to content

💻 Git custom command that will do a full "sanitize" of a branch

License

Notifications You must be signed in to change notification settings

devpow112/git-sanitize

Repository files navigation

Git Sanitize

License Version Release Node Version

Git custom command that will do a full "sanitize" of a branch. This will reset the branch and all submodules to be back to the branches HEAD state by effectively running the following.

git clean -xfdf
git submodule foreach --recursive git clean -xfdf
git reset --hard
git submodule foreach --recursive git reset --hard
git submodule update --init --recursive

Installation

npm i -g git-sanitize

Usage

git sanitize

Development

Development can be done on any machine that can install Node.js.

Install Dependencies

Install dependencies via npm.

npm i

Linting

Execute linters via npm.

# git, javascript, markdown and package.json
npm run lint

# git only
npm run lint:git

# javascript only
npm run lint:js

# markdown only
npm run lint:md

# package.json only
npm run lint:pkg

Fixing

Execute automatic fixers via npm.

# javascript, markdown and package.json
npm run fix

# javascript only
npm run fix:js

# markdown only
npm run fix:md

# package.json only
npm run fix:pkg

Building

Run a build via npm.

npm run build