Skip to content

Instantly share code, notes, and snippets.

@laage
Last active August 2, 2017 10:32
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 laage/c4295f8139678fa214959888cbc96031 to your computer and use it in GitHub Desktop.
Save laage/c4295f8139678fa214959888cbc96031 to your computer and use it in GitHub Desktop.
.gitconfig for Windows. Requires P4Merge for visual merge and Visual Studio Code as commit editor and diff tool. 2017-08-02
[user]
name = [NAME]
email = [EMAIL ADDRESS]
[core]
# Visual Studio Code required
editor = code --wait
# Change to match user path
excludesfile = C:/Users/[USERNAME]/.gitignore_global
[color]
# Enable default colors for many commands
ui = auto
status = always
[push]
default = simple
# "push the current branch back to the branch whose changes are usually integrated into the current branch"
# "refuse to push if the upstream branch’s name is different from the local one"
# https://git-scm.com/docs/git-config#git-config-pushdefault
followTags = true
# Because I get sick of telling git to do it manually
# https://git-scm.com/docs/git-config#git-config-pushfollowTags
[status]
showUntrackedFiles = all
# Sometimes a newly-added folder, since it's only one line in git status, can slip under the radar.
# https://git-scm.com/docs/git-config#git-config-statusshowUntrackedFiles
# Visual Diff requires Visual Studio Code
[diff]
tool = default-difftool
[difftool "default-difftool"]
cmd = code --wait --diff $LOCAL $REMOTE
[difftool]
prompt = false
# Visual Merge requires the Perforce p4merge tool
[merge]
tool = p4merge
[mergetool "p4merge"]
path = C:/Program Files/Perforce/p4merge.exe
[alias]
hist = log --all --graph --decorate --oneline
co = checkout
ci = commit
st = status
br = branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment