# Your Global .gitconfig

DevFeed: [Your Global .gitconfig](<https://devfeed.tech/articles/your-global-gitconfig-28173.md>)

Original publisher: [Read original article](<http://fuzzyblog.io/blog/git/2020/03/03/your-global-gitconfig.html>)

Author: Fuzzygroup

Published: 2020-03-03T00:00:00Z

Content type: tutorial

Language: en

Sources: [Scott Johnson](<https://devfeed.tech/sources/scott-johnson.md>)

Topics: [Git](<https://devfeed.tech/topics/git.md>), [osx](<https://devfeed.tech/topics/osx.md>)

Tags: [color](<https://devfeed.tech/tags/color.md>), [command](<https://devfeed.tech/tags/command.md>), [commands](<https://devfeed.tech/tags/commands.md>), [files](<https://devfeed.tech/tags/files.md>), [git](<https://devfeed.tech/tags/git.md>), [graph](<https://devfeed.tech/tags/graph.md>)

## AI overview

A developer shares a global Git configuration with aliases for commands such as trash, checkout, status, branch, and a graph-formatted log. The configuration also sets color options, a global ignore file for .DS_Store, merge and diff tools, Git LFS filters, and push behavior.

## Source excerpt

I had a question recently about my use of git trash which isn't a standard git command. I accomplished this, about a decade ago, by modifying ~/.gitconfig and, well, I haven't thought about it ever since. Here's my ~/.gitconfig as an example. [color] diff = auto status = auto branch = auto [color "branch"] current = yellow reverse local = yellow remote = green [color "diff"] meta = yellow bold frag = magenta bold old = red bold new = green bold [color "status"] added = yellow changed = green untracked = cyan [user] name = Scott Johnson email = blahblahblah@gmail.com [alias] co = checkout st = status br = branch trash = checkout -f lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit [apply] whitespace = nowarn [core] excludesfile = /Users/sjohnson/.gitignore_global [difftool "sourcetree"] cmd = opendiff \"$LOCAL\" \"$REMOTE\" path = [mergetool "sourcetree"] cmd = /Applications/SourceTree.app/Contents/Resources/opendiff-w.sh \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\" trustExitCode = true [filter "lfs"] clean = git-lfs clean -- %f smudge = git-lfs smudge -- %f required = true process = git-lfs filter-process [push] default = simple The key thing, to support git trash, is the [alias] section. This is where you can define your own custom commands based on the fundamental git primitives. My git lg command is also pretty nice (and courtesy from Sean Kennedy). Another really, really useful thing is the excludesfile setting which lets you tell git to never, ever worry about a file like the cursed .DS_Store files which OSX persists in generating. This is generally stored in something like /Users/username/.gitignore_global.