Skip to content

Instantly share code, notes, and snippets.

@cassiozen
Created December 21, 2020 18:59
Show Gist options
  • Save cassiozen/3263d19cc71793441d55b36c9a1fc737 to your computer and use it in GitHub Desktop.
Save cassiozen/3263d19cc71793441d55b36c9a1fc737 to your computer and use it in GitHub Desktop.
GitConfig
[user]
name = XXX
email = XXX
[alias]
ci = commit
co = checkout
st = status
# update local branch with latest stuff from origin and rebase any local commits
up = !git pull --rebase --prune $@ && git submodule update --init --recursive
# Get the current branch name (not so useful in itself, but used in other aliases)
branch-name = "!git rev-parse --abbrev-ref HEAD"
# Push the current branch to the remote "origin", and set it to track upstream
publish = "!git push -u origin $(git branch-name)"
# Delete the remote version of the current branch
unpublish = "!git push origin :$(git branch-name)"
# Clean branches already merged into master (except for dev & stg)
cleanup = "!git branch --merged master | grep -v '\\*\\|master\\|dev|stg' | xargs -n 1 git branch -d"
[pull]
rebase = true
[rebase]
autostash = true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment