Skip to content

Instantly share code, notes, and snippets.

@andreasciamanna
Last active February 11, 2016 13:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andreasciamanna/e5fbe68ef0947b8191de to your computer and use it in GitHub Desktop.
Save andreasciamanna/e5fbe68ef0947b8191de to your computer and use it in GitHub Desktop.
[user]
name = FULL NAME
email = email@address.tld
logallrefupdates=true
[core]
#MANDATORY!!!
#Use `true` instead of `input` in Windows environments
autocrlf = input
#Use the full path of the executable if this doesn't work
#Also use whatever editor you prefer
editor = sublime -n -w
#Changes in file permissions will be ignored: please use it!
filemode = false
[push]
#MANDATORY
#`git push` (without passing a refspec) will fail
#if the current branch isn't tracking a remote upstream branch
#(even if a branch with the same name exists on the remote)
default = simple
[alias]
#Here's a bunch of aliases/shortcuts you can ignore, if you don't need them
co = checkout
ec = config --global -e
up = !git pull --rebase --prune $@ && git submodule update --init --recursive
cob = checkout -b
cm = !git add -A && git commit -m
save = !git add -A && git commit -m 'SAVEPOINT'
wip = !git add -u && git commit -m "WIP"
undo = reset HEAD~1 --mixed
amend = commit -a --amend
wipe = !git add -A && git commit -qm 'WIPE SAVEPOINT' && git reset HEAD~1 --hard
bclean = "!f() { git branch --merged ${1-master} | grep -v " ${1-master}$" | xargs -r git branch -d; }; f"
bdone = "!f() { git checkout ${1-master} && git up && git bclean ${1-master}; }; f"
search = log -S
migrate = "!f(){ CURRENT=$(git symbolic-ref --short HEAD); git checkout -b $1 && git branch --force $CURRENT ${3-'$CURRENT@{u}'} && git rebase --onto ${2-master} $CURRENT; }; f"
lg = log --graph --oneline --decorate --all
lg2 = log --after="2015-10-13" --no-merges --format=format:'%ci: %Cred%h%Creset %Cblue%an%Creset %s' for-3.2.8
pl = pull -—rebase
[merge]
#MANDATORY
#See here:
#http://aaronbonner.io/post/78444674979/only-allow-git-fast-forward-merges-to-avoid-ugly
ff = only
[branch]
#MANDATORY
#Force *all new* branches to automatically use rebase
#See here:
#http://stevenharman.net/git-pull-with-automatic-rebase
autosetuprebase = always
[branch "master"]
#MANDATORY
#Force *existing* branches to use rebase.
#See here:
#http://stevenharman.net/git-pull-with-automatic-rebase
rebase = true
[branch "develop"]
#MANDATORY
#Force *existing* branches to use rebase.
#See here:
#http://stevenharman.net/git-pull-with-automatic-rebase
rebase = true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment