git merge-request
Get or create a GitLab Merge Request for the current branch.
Usage
fns-cli git merge-request
fns-cli git mrAliases
mr
Flags
| Flag | Description |
|---|---|
-h, --help | Show help |
How it works
If a Merge Request already exists:
- Displays each MR with its title, reference (e.g.
group/project!42), and state (color-coded: green for open, red for closed, gray for others). - Shows the full MR JSON payload.
- Then runs
fns-cli git pipelinesto show recent pipeline status.
If no Merge Request exists:
- Prompts to confirm creating one.
- If confirmed, pre-fills the MR payload:
- Title:
Draft: ISSUE-KEY: branch description(derived from the branch name) - Description:
Refs: <jira-issue-url>(inferred from branch) - Target branch: auto-detected (
develop>main>master) - Squash: enabled
- Assignee: your GitLab user ID from config
- Title:
- Displays the payload for review and prompts to confirm before creating.
- After creation, shows the new MR and runs
fns-cli git pipelines.
Tips
- The GitLab project namespace is inferred automatically from the git remote URL.
- MRs are created as Draft by default — remove the
Draft:prefix in GitLab when ready to merge. - The Jira issue URL in the description is inferred from the branch name (requires a
PROJECT-1234pattern). - The target branch selection order is:
develop→main→master.
