Skip to content

Instantly share code, notes, and snippets.

@seangwright
Last active January 30, 2016 06:15
Show Gist options
  • Save seangwright/91e4861c4569e57823f3 to your computer and use it in GitHub Desktop.
Save seangwright/91e4861c4569e57823f3 to your computer and use it in GitHub Desktop.
Helpful windows .gitconfig
[user]
name = Your Name
email = email@site.com
[core]
autocrlf = true
excludesfile = c:/path/to/your/repos/global.gitignore
# The default editor used when git needs one for you to interact with (ie 'git commit' without a message)
editor = 'C:/path/to/editor/of/choice/editor.exe' -options -for -editor
[gui]
# Git GUI recent repo
recentrepo = c:/path/to/a/recent/repo
[alias]
# A pretty log that displays a commit graph with details about the commits
# * ad49s0 - (HEAD, origin/master, master) Commit message here (x minutes ago) <User Name>
hist = log --graph --pretty=format:'%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%cr) %C(cyan)<%an>%Creset' --abbrev-commit --date=relative
# Tells you what files were changed in a commit
# git committed 7fd80b
# A index.html
committed = diff-tree --no-commit-id --name-status --root -r
[push]
# When 'git push' is entered git will only push if the branc being pushed is tracking a remote upstream branch
# http://stackoverflow.com/a/23918418/939634
# This prevents pushing to upstream branches accidentally
default = simple
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment