Skip to content

Instantly share code, notes, and snippets.

@plembo
Last active October 15, 2021 19:32
Show Gist options
  • Save plembo/79a7bdc8c6273cfe08ad1b133b92bb39 to your computer and use it in GitHub Desktop.
Save plembo/79a7bdc8c6273cfe08ad1b133b92bb39 to your computer and use it in GitHub Desktop.
My .gitconfig

My .gitconfig

Not presented as any kind of model or standard, but just what I've done for myself:

[user]
	name = Phil Lembo
	email = [email protected]
[push]
	default = simple
[alias]
	glog = log --oneline --decorate --graph --all
	co = checkout
	br = branch
	ci = commit
	st = status
	unstage = reset HEAD --
	last = log -1 HEAD
[core]
	autocrlf = input
	editor = code --wait --new-window
[diff]
	tool = default-difftool
[difftool "default-difftool"]
	cmd = code --wait --new-window --diff $LOCAL $REMOTE
[merge]
	tool = default-mergetool
[mergetool "default-mergetool"]
    	cmd = code --wait --new-window $MERGED
[color]
	ui = true
[init]
	defaultBranch = main
[pull]
	rebase = false

Note that I've gone all in on integrating Microsoft's Visual Studio Code ("code" or "vscode") as my editor of choice. Most people on Linux (like me up until a few weeks ago) are more comfortable with the defaults for the core, diff and merge sections, which basically use vim for the editor and don't provide anything for diff and merge. While I still use vim a lot on servrs, vscodeis what's usually open on my desktop (although by specifying "--new-window" any git related operations in vscode will be done in a new window).

References

"Using Version Control in VS Code: VS Code as Git editor". Visual Studio Code Docs, https://code.visualstudio.com/docs/editor/versioncontrol#_git-support.

Scott Chacon, Ben Straub. "8.1 Customizing Git - Git Configuration". Pro Git, 2nd ed. APress, 2014, https://git-scm.com/book/en/v2/Customizing-Git-Git-Configuration.

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