Created
March 6, 2019 04:08
-
-
Save gundamew/1ada9aadb39b8b2539ffd44c4faf094a to your computer and use it in GitHub Desktop.
Checkout GitLab merge request locally.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -euo pipefail | |
# Ref: | |
# * https://stackoverflow.com/a/44992513 | |
# * https://github.com/jwiegley/git-scripts/blob/master/git-pr | |
test -z $1 && echo "Merge request number required." 1>&2 && exit 1 | |
git fetch ${2:-origin} merge-requests/$1/head:mr-$1 && git checkout mr-$1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment