Add pr shortcut for GitHub

This commit is contained in:
exu 2023-07-12 18:31:39 +02:00
parent d5092cb54e
commit 65ff76d36d

View File

@ -1,7 +1,11 @@
[init]
defaultBranch = main
[alias]
mr = !sh -c 'git fetch $1 merge-requests/$2/head:mr-$1-$2 && git checkout mr-$1-$2' -
# use like this: git mr [REPO] [MERGE REQUEST]
# see https://stackoverflow.com/a/50834005 (GitLab)
# see https://gist.github.com/gnarf/5406589 (GitHub, modified to be similar to GitLab)
mr = !sh -c 'git fetch -fu $1 merge-requests/$2/head:mr-$1-$2 && git checkout mr-$1-$2' -
pr = !sh -c 'git fetch -fu $1 refs/pull/$2/head:pr-$1-$2 && git checkout pr-$1-$2' -
[user]
name = exu
email = mrc@frm01.net