Skip to content

Instantly share code, notes, and snippets.

@smoothml
Created April 15, 2019 08:48
Show Gist options
  • Save smoothml/5a32091bb16edf86360b5e10c3e4977d to your computer and use it in GitHub Desktop.
Save smoothml/5a32091bb16edf86360b5e10c3e4977d to your computer and use it in GitHub Desktop.
[alias]
st = status
br = branch
co = checkout
cm = commit -m
# Pull in remote changes for the current repository and all its submodules
pr = !"git pull; git submodule foreach git pull origin master"
# Switch to a branch, creating it if necessary
go = "!f() { git checkout -b \"$1\" 2> /dev/null || git checkout \"$1\"; }; f"
# Amend the currently staged files to the latest commit
amend = commit --amend --reuse-message=HEAD
# A more succinct log
hist = "log --pretty=format:'%h - %an, %ar : %s'"
# Checkout submodules nicely
su = "!git submodule update --init --remote --recursive"
# Show verbose output about tags, branches or remotes
tags = tag -l
branches = branch -a
remotes = remote -v
# Remove branches that have already been merged with master
# a.k.a. ‘delete merged’
dm = "!git branch --merged | egrep -v '^\\*|release/' | xargs -n 1 git branch -d"
rpo = "!git remote prune origin"
sweep = "!git checkout master && git pull && git rpo && git dm"
[core]
# Make `git rebase` safer on OS X
# More info: <http://www.git-tower.com/blog/make-git-rebase-safe-on-osx/>
trustctime = false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment