Skip to content

Instantly share code, notes, and snippets.

@shorti1996
Last active August 13, 2020 08:53
Show Gist options
  • Save shorti1996/59ba6b1a749da01469382681cc39f1d8 to your computer and use it in GitHub Desktop.
Save shorti1996/59ba6b1a749da01469382681cc39f1d8 to your computer and use it in GitHub Desktop.
Git review alias
git config alias.review "\!f() { prnumber=\$1; repo=\$2; [ -z \${repo} ] && repo=base;
git fetch \${repo} pull-requests/\${prnumber}/from && git checkout FETCH_HEAD; }; f"
git config alias.review "!f() { prnumber=$1; repo=$2; [ -z ${repo} ] && repo=base; git
fetch ${repo} pull-requests/${prnumber}/from && git checkout FETCH_HEAD; }; f"
git config alias.review "\!f() { prnumber=\$1; repo=\${2:-origin};
git fetch \${repo} merge-requests/\${prnumber}/head && git checkout FETCH_HEAD; }; f"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment