Skip to content

Instantly share code, notes, and snippets.

@kyktommy
Last active September 9, 2020 03:53
Show Gist options
  • Save kyktommy/d2a32a977a22dd9a253c167d9373e487 to your computer and use it in GitHub Desktop.
Save kyktommy/d2a32a977a22dd9a253c167d9373e487 to your computer and use it in GitHub Desktop.
git helper
# pull latest with stash
function gitup() {
git stash -u
git pull --rebase
git stash pop
}
# stash staged
function gitstash() {
git stash push -m $1 -- $(git diff --staged --name-only)
}
# pull all remote branch
function gitall() {
git branch -r | grep -v '\->' | while read remote; do git branch --track "${remote#origin/}" "$remote"; done
git fetch --all
git pull --all
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment