LinuxCommandLibrary

git-mr

Create merge requests from the command line

TLDR

Check out a specific merge request

$ git mr [mr_number]
copy

Check out a merge request from a specific remote
$ git mr [mr_number] [remote]
copy

Checkout a merge request from its URL
$ git mr [url]
copy

Clean up old merge request branches
$ git mr clean
copy

SYNOPSIS

git-mr [global-options] <command> [<args>]
Common commands: create, list, view, checkout, merge, close

PARAMETERS

-h, --help
    Display help information

-v, --verbose
    Enable verbose logging

--version
    Print git-mr version

--service SERVICE
    Override service (github/gitlab/bitbucket)

--remote REMOTE
    Specify Git remote name

--no-edit
    Skip opening editor for title/body (create command)

--draft
    Create as draft MR/PR

--reviewer REVIEWERS
    Add reviewers (comma-separated usernames)

DESCRIPTION

git-mr is a third-party command-line tool (Ruby gem) for managing merge requests (MRs) and pull requests (PRs) on platforms like GitHub, GitLab, and Bitbucket. It streamlines workflows by allowing users to create, list, view, checkout, approve, merge, or close MRs/PRs directly from the terminal, integrating with hosting service APIs.

Key features include branch synchronization, status checks, and configuration via YAML files for tokens and settings. It reduces context-switching between terminal and web UIs, ideal for developers in CI/CD pipelines or daily Git workflows. Not part of core git; requires separate installation.

CAVEATS

Third-party tool; install via gem install git-mr. Requires API tokens in config (~/.gitmr.yml). Limited platform support; check compatibility with your host. Not available in standard Linux repos.

INSTALLATION

Run gem install git-mr or brew tap bkuhlmann/formulae && brew install git-mr. Source: github.com/bkuhlmann/git-mr.

CONFIGURATION

Edit ~/.gitmr.yml with service tokens:
github:
  token: xxx
gitlab:
  token: yyy

EXAMPLE USAGE

git-mr create --title 'Fix bug' --description 'Details'
git-mr list --mine

HISTORY

Initial release ~2014 by bkuhlmann (Ruby gem). Evolved for multi-platform support; forks like postmortemdev/git-mr added features. Usage peaked in GitLab-heavy workflows pre-native CLIs like gh and glab. Maintenance sporadic as of 2023.

SEE ALSO

git(1), gh(1), glab(1), hub(1), mr(1)

Copied to clipboard