Skip to content

Instantly share code, notes, and snippets.

@Ross-Hunter
Created March 9, 2017 15:46
Show Gist options
  • Save Ross-Hunter/4ee423c286565544591284e28546828a to your computer and use it in GitHub Desktop.
Save Ross-Hunter/4ee423c286565544591284e28546828a to your computer and use it in GitHub Desktop.
My Git Files
[include]
path = ~/.gitconfig-core
path = ~/.gitconfig-aliases
[user]
name =
email =
[alias]
pr = !zsh -ic open-pr
[core]
autocrlf = input
[branch]
autosetuprebase = always
[alias]
a = add -A
s = status
st = status
co = checkout
p = pull
pl = pull
pul = pull
pulll = pull
pus = push
puhs = push
re = rebase
rebae = rebase
# Push your branch to the remote
cbranch = rev-parse --abbrev-ref HEAD
pushr = !git push -u origin `git cbranch`
# These are useful when pulling with rebase
pullstash = !git add -A && git stash && git pull
pullpop = !git add -A && git stash && git pull && git stash pop
stashall = !git add -A && git stash
# Pretty log output
lg = !git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
# Add all new files, then interactively add changed files
ap = !git add -N . && git add -p
# Pull using rebase instead of merging
lr = !git pull --rebase
# Make a quick WIP commit
wip = !git add -A && git commit -m 'WIP'
# Commit all changes
ca = !git add -A && git commit -av
# Switch to a branch, creating it if necessary
go = !git checkout -b \"$1\" 2> /dev/null || git checkout \"$1\";
# Amend the currently staged files to the latest commit
amend = commit --amend --reuse-message=HEAD
# Interactive rebase with the given number of latest commits
reb = "!r() { git rebase -i HEAD~$1; }; r"
# Delete merged branches
clb = !git branch --merged | grep -v '\\*\\|master\\|develop\\|staging' | xargs -n 1 git branch -d
[branch]
autosetuprebase = always
[rebase]
autosquash = true
[diff]
renames = true
[core]
excludesfile = ~/.gitignore_global
mergeoptions = --no-ff
editor = vim
autocrlf = input
[push]
default = simple
[credential]
helper = osxkeychain
[remote "origin"]
prune = true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment