Skip to content

Latest commit

 

History

History
83 lines (53 loc) · 2.45 KB

File metadata and controls

83 lines (53 loc) · 2.45 KB

CLI

How to use AutoCommitMsg in the terminal instead of as an extension

See steps below to setup and run the tool in the CLI. VS Code is not needed.

For development, see CLI Development.

This should work on Windows too but has not been tested yet.

Install

Requires Git and Node.

$ git clone git@github.com:MichaelCurrin/auto-commit-msg.git
$ cd auto-commit-msg
$ npm install
$ npm run cli:install

To setup as a pre-commit hook, see Shell

Usage

Use the -h or --help flags with any of these to avoid making changes.

Generate a message from changes and commit

This is the main command you should use.

Note this will commit, so if you want to experiment with commit output without committing, use the command below instead.

No flags are needed.

$ gacm --help

Check Git changes and generate commit message

This will not commit.

No flags are needed.

$ acm --help

Generate a message from staged changes

This is a simpler command which does not interact with Git, intended for integrating with the Bash shell.

$ auto_commit_message_generate "$CHANGES"

Usage tips

The behavior depends on how Git treats files, so you should know these points:

  • The commands will pick up on staged changes and certain unstaged changes (modified and deleted, but not created as they are untracked).
  • If you want to handle created files, make sure to stage them first.
  • If you want to target only select changes for smaller commit, then stage stages and use the --cached flag to ignored unstaged changes.

Uninstall the linked CLI (optional)

If you get permission denied error, you can do this and then go back to the install step.

$ npm unlink -g auto-commit-msg