Adds git shorthand functions for shell
This commit is contained in:
parent
530ce58896
commit
91de4f7690
1 changed files with 21 additions and 0 deletions
21
.git_functions.sh
Normal file
21
.git_functions.sh
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
# combine fetch and rebase (git frebase)
|
||||||
|
function wgfreebase {
|
||||||
|
if [ -z $1 ]; then
|
||||||
|
branchname="$(git symbolic-ref HEAD 2> /dev/null | cut -f3 -d'/')"
|
||||||
|
else
|
||||||
|
branchname="$1"
|
||||||
|
fi
|
||||||
|
|
||||||
|
git fetch origin "$branchname" && git rebase origin/"$branchname"
|
||||||
|
}
|
||||||
|
|
||||||
|
# push to current branch
|
||||||
|
function wgpush {
|
||||||
|
if [ -z $1 ]; then
|
||||||
|
branchname="$(git symbolic-ref HEAD 2> /dev/null | cut -f3 -d'/')"
|
||||||
|
else
|
||||||
|
branchname="$1"
|
||||||
|
fi
|
||||||
|
|
||||||
|
git push origin $branchname
|
||||||
|
}
|
Loading…
Reference in a new issue