Skip to content

git commit

Commit currently staged changes with an automatically enriched commit message.

Usage

fns-cli git commit <message...>

Arguments

ArgumentDescription
messageRequired. One or more words forming the commit message.

Flags

FlagDescription
-h, --helpShow help

How it works

  1. Reads the current git branch name.
  2. If a Jira issue key is found in the branch name (e.g. FCLI-1234), the commit message is automatically prefixed with it and a Refs: line with the Jira issue URL is appended as a second -m value.
  3. Runs git commit with the enriched message.
  4. Prints the latest commit via git log -n 1.

Example

On branch FCLI-42-fix-login-bug, running:

fns-cli git commit "fix null pointer on login"

Produces a commit equivalent to:

git commit -m "FCLI-42: fix null pointer on login" -m "Refs: https://yourorg.atlassian.net/browse/FCLI-42"

Tips

  • Only staged changes are committed — run git add before using this command.
  • If the branch name does not contain a Jira issue key, the commit message is used as-is.
  • Words passed as arguments are joined with spaces, so quoting is optional: fns-cli git commit fix the bug works the same as fns-cli git commit "fix the bug".