git commit
Commit currently staged changes with an automatically enriched commit message.
Usage
fns-cli git commit <message...>Arguments
| Argument | Description |
|---|---|
message | Required. One or more words forming the commit message. |
Flags
| Flag | Description |
|---|---|
-h, --help | Show help |
How it works
- Reads the current git branch name.
- If a Jira issue key is found in the branch name (e.g.
FCLI-1234), the commit message is automatically prefixed with it and aRefs:line with the Jira issue URL is appended as a second-mvalue. - Runs
git commitwith the enriched message. - 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 addbefore 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 bugworks the same asfns-cli git commit "fix the bug".
