Skip to content

Instantly share code, notes, and snippets.

@jschwarty
Last active October 12, 2019 17:22
Show Gist options
  • Save jschwarty/c7b7af208c55ff657c31fe74a0fb5021 to your computer and use it in GitHub Desktop.
Save jschwarty/c7b7af208c55ff657c31fe74a0fb5021 to your computer and use it in GitHub Desktop.
Custom functions for oh-my-zsh terminal to work with common git stuff
# Sync master with remote upstream (and re-checkout previous branch)
function gitsum {
currentBranch=$(git symbolic-ref -q --short HEAD)
git fetch upstream
git checkout master
git merge upstream/master
git push
git checkout $currentBranch
}
# Add remote upstream
function grup {
git remote add upstream $1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment