Skip to content

Instantly share code, notes, and snippets.

@sachee
Created June 25, 2015 01:12
Show Gist options
  • Save sachee/fa67b235512f16f2145c to your computer and use it in GitHub Desktop.
Save sachee/fa67b235512f16f2145c to your computer and use it in GitHub Desktop.
alias gcurrbranch='git rev-parse --abbrev-ref HEAD'
function gupush()
{
branch=${1:-$(gcurrbranch)}
echo "git push -u origin $branch"
git push origin $branch
}
function gpush()
{
branch=${1:-$(gcurrbranch)}
echo "git push origin $branch"
git push origin $branch
}
function gpull()
{
branch=${1:-$(gcurrbranch)}
echo "git pull origin $branch"
git pull origin $branch
}
function gprebase()
{
branch=${1:-$(gcurrbranch)}
echo "git pull --rebase origin $branch"
git pull --rebase origin $branch
}
function gdeletemerged()
{
git branch --merged | grep -v "\*" | grep -v "master" | xargs -n 1 git branch -d
}
function gsub()
{
git submodule sync --recursive
git submodule update --init --recursive
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment