Skip to content

Instantly share code, notes, and snippets.

@hyrmn
Last active December 21, 2015 05:49
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hyrmn/6259521 to your computer and use it in GitHub Desktop.
Save hyrmn/6259521 to your computer and use it in GitHub Desktop.
my .gitconfig
[user]
name = Ben Hyrman
email = ben.hyrman@gmail.com
[core]
autocrlf = true
editor = vim
excludesfile = C:\\Users\\Ben\\Documents\\gitignore_global.txt
[credential]
helper = !~/AppData/Roaming/GitCredStore/git-credential-winstore
[merge]
keepBackup = false
tool = p4merge
defaultToUpstream = true
[mergetool "p4merge"]
cmd = p4merge.exe "$BASE" "$LOCAL" "$REMOTE" "$MERGED"
keepTemporaries = false
trustExitCode = true
keepBackup = false
[diff]
tool = p4merge
[difftool "p4merge"]
cmd = "p4merge.exe $LOCAL $REMOTE"
[push]
default = tracking
[pull]
rebase = true
[branch]
autosetupmerge = true
autosetuprebase = always
[alias]
st = status
ca = "!git add -A" && "git commit -m"
br = branch
up = "!f() { git co master; git fetch; git merge --ff-only origin/master; }; f"
fuckit = "!f() { git clean -d -x -f; git reset --hard; }; f"
co = checkout
df = diff
lg = log -p
del = branch -d
udel = branch -D
cob = checkout -b
ready = rebase -i origin/master
finish = "!f() { git co master; git merge $1; git push origin master; git del $1; }; f"
standup = "!git log --since yesterday --author `git config user.email` --date=short --pretty=format:'%ad - %s'"
weekly = "!git log --since 1.week --author `git config user.email` --date=short --pretty=format:'%ad - %s'"
today = log --stat --since yesterday --graph --pretty=oneline --abbrev-commit --date=relative
scoreboard = "!git log | grep '^Author' | sort | uniq -ci | sort -r"
accept-ours = "!f() { files=\"$@\"; [ -z $files ] && files='.'; git checkout --ours -- $files; git add -u $files; }; f"
accept-theirs = "!f() { files=\"$@\"; [ -z $files ] && files='.'; git checkout --theirs -- $files; git add -u $files; }; f"
ls = log --format=format:'%C(bold yellow)%h %C(reset) %s %C(green) [%an] %C(reset)' --decorate
ll = log --pretty=format:'%C(bold yellow)%h %C(reset) %s %C(green) [%an] %C(reset)' --decorate --numstat
lg1 = log --graph --all --format=format:'%C(bold yellow)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(bold white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --abbrev-commit --date=relative
lg2 = log --graph --all --format=format:'%C(bold yellow)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n''%C(white)%s%C(reset) %C(bold white)- %an%C(reset)' --abbrev-commit
lg = !"git lg1"
save = stash save
pop = stash pop --index
yolo = !git add -A && git commit -m \"$(curl -s whatthecommit.com/index.txt)\" && git push -f origin HEAD:master
[help]
autocorrect = 1
@hyrmn
Copy link
Author

hyrmn commented Aug 18, 2013

@datachomp pointed out that the git push should have a -force option on it. If you care enough to yolo, you care enough to yolo correctly.

@dahlbyk
Copy link

dahlbyk commented Aug 18, 2013

I'd probably go with ... && git push -f origin HEAD:master, to make sure whatever you just committed ends up in master.

@hyrmn
Copy link
Author

hyrmn commented Aug 18, 2013

Updated per @dahlbyk's feedback

(also of note, I have push set to current, so my normal workflow is just 'git push' on master once I've merged my branch in)

@hyrmn
Copy link
Author

hyrmn commented Jan 28, 2014

Got rid of the pull /rebase alias

@hyrmn
Copy link
Author

hyrmn commented Mar 23, 2014

Added fuckit alias courtesy of @khalidabuhakmeh

@khalidabuhakmeh
Copy link

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment