add aliases to sync with other remotes and checkout pull requests
This commit is contained in:
@@ -28,8 +28,10 @@
|
|||||||
ra = !git r --all
|
ra = !git r --all
|
||||||
l = "!source ~/.githelpers && pretty_git_log"
|
l = "!source ~/.githelpers && pretty_git_log"
|
||||||
la = !git l --all
|
la = !git l --all
|
||||||
|
sync = "!source ~/.githelpers && sync_to_remote"
|
||||||
|
|
||||||
todo = grep --heading --break --ignore-case -e ' FIX: *' -e ' TODO: *'
|
todo = grep --heading --break --ignore-case -e ' FIX: *' -e ' TODO: *'
|
||||||
|
pr = "!source ~/.githelpers && get_pr"
|
||||||
[merge]
|
[merge]
|
||||||
tool = vimdiff
|
tool = vimdiff
|
||||||
ff = false
|
ff = false
|
||||||
|
|||||||
@@ -40,3 +40,17 @@ pretty_git_log() {
|
|||||||
less -FXRS
|
less -FXRS
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sync_to_remote() {
|
||||||
|
REMOTE=$1
|
||||||
|
: ${REMOTE:="upstream"}
|
||||||
|
BRANCH=`git rev-parse --abbrev-ref HEAD`
|
||||||
|
git fetch upstream
|
||||||
|
git merge --ff-only ${REMOTE}/${BRANCH};
|
||||||
|
}
|
||||||
|
|
||||||
|
get_pr() {
|
||||||
|
REMOTE=$2
|
||||||
|
: ${REMOTE:="upstream"}
|
||||||
|
git fetch ${REMOTE} pull/${1}/head:pr/${1}
|
||||||
|
git checkout pr/${1}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user