From 33defae27b862650a3cc98d847414c98b26243f8 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sun, 28 Feb 2021 00:29:22 -0500 Subject: add git command to pull a github pr --- bin/git/git-pr | 5 +++++ config/git/config | 1 + 2 files changed, 6 insertions(+) create mode 100755 bin/git/git-pr diff --git a/bin/git/git-pr b/bin/git/git-pr new file mode 100755 index 0000000..61346bc --- /dev/null +++ b/bin/git/git-pr @@ -0,0 +1,5 @@ +#!/bin/sh + +pr_num="$1" +upstream="${2-origin}" +git fetch "$upstream" "pull/${pr_num}/head:pull-${pr_num}" diff --git a/config/git/config b/config/git/config index 30584de..0d3a10e 100644 --- a/config/git/config +++ b/config/git/config @@ -23,6 +23,7 @@ info = remote show -n origin lg = log --graph --pretty=format:'%Cred%h%Creset%C(yellow)%d%Creset %C(bold blue)%aN%Creset %C(magenta)(%ar)%Creset%n%s%n' --abbrev-commit --date=relative --stat=72 m = "!f() { git co master && git pull && EDITOR=true git merge --no-ff \"$@\" && git bda; }; f" + pr = !~/.bin/git/git-pr prune-all = !git remote | xargs -n 1 git remote prune pushall = "!f() { for repo in origin github; do git push $repo \"$@\"; done; }; f" record = !git add -p && git commit --verbose -- cgit v1.2.3-54-g00ecf