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
|
|
@ -32,10 +32,12 @@
|
|||
# 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"
|
||||
# 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]
|
||||
gpgsign = true # sign commits as me
|
||||
verbose = true # Always show diff when preparing commit message
|
||||
[tag]
|
||||
gpgsign = true
|
||||
[fetch]
|
||||
prune = true # remove references to non-existent remote branches
|
||||
[pull]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue