git: Add pr alias which fetches a specific github pull request
Used like `g pr 1234` to create local pr/1234 branch.
This commit is contained in:
parent
43aefd2369
commit
98c54443e9
1 changed files with 5 additions and 3 deletions
|
|
@ -30,12 +30,14 @@
|
||||||
delta = "![ $TERM_DARK = false ] && delta --light || delta" # Take care that we always display right color scheme
|
delta = "![ $TERM_DARK = false ] && delta --light || delta" # Take care that we always display right color scheme
|
||||||
|
|
||||||
# check out a github PR directly on the commandline, creates pr/4 or pr/<number> branch locally
|
# check out a github PR directly on the commandline, creates pr/4 or pr/<number> branch locally
|
||||||
pr = "!f() { git fetch -fu ${2:-$(git remote |grep ^github || echo origin)} refs/pull/$1/head:pr/$1 }; f"
|
pr = "!f() { git fetch -fu ${2:-$(git remote |grep ^github || echo origin)} refs/pull/$1/head:pr/$1 }; f"
|
||||||
# remove all pr/<number> local branches
|
# remove all pr/<number> local branches
|
||||||
pr-clean = "!git for-each-ref refs/heads/pr/* --format='%(refname)' | while read ref ; do branch=${ref#refs/heads/} ; git branch -D $branch ; done"
|
pr-clean = "!git for-each-ref refs/heads/pr/* --format = '%(refname)' | while read ref ; do branch = ${ref#refs/heads/} ; git branch -D $branch ; done"
|
||||||
[commit]
|
[commit]
|
||||||
gpgsign = true # sign commits as me
|
gpgsign = true # sign commits as me
|
||||||
verbose = true # Always show diff when preparing commit message
|
verbose = true # Always show diff when preparing commit message
|
||||||
|
[tag]
|
||||||
|
gpgsign = true
|
||||||
[fetch]
|
[fetch]
|
||||||
prune = true # remove references to non-existent remote branches
|
prune = true # remove references to non-existent remote branches
|
||||||
[pull]
|
[pull]
|
||||||
|
|
@ -45,7 +47,7 @@
|
||||||
[difftool]
|
[difftool]
|
||||||
prompt = false
|
prompt = false
|
||||||
[difftool "difftastic"]
|
[difftool "difftastic"]
|
||||||
cmd = difft "$LOCAL" "$REMOTE"
|
cmd = difft "$LOCAL" "$REMOTE"
|
||||||
[color "diff"]
|
[color "diff"]
|
||||||
meta = "9"
|
meta = "9"
|
||||||
frag = "magenta bold"
|
frag = "magenta bold"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue