Everyone knows that git happens. Don't fling it at your coworkers.
Git configuration comes in three categories: personal preference, good idea, and essential for life.
This is essential for life.
Git keeps global configuration in .gitconfig in your home directory. Don’t edit this file directly. Instead use the configuration commands in git. Show and modify configuration with
git config.
The--global
makes the configuration apply to all your repositories. Without that, settings are local to the repo (and stored in.git/.gitconfig
.)
git config --global user.name "John Doe"
git config --global user.email johndoe@example.com
git config --global core.editor textedit
Change `textedit` to your editor of choice. The GIT_EDITOR environment variable, if set, will override this. > This editor is launched whenever git wants you to create or edit a commit message, or for an interactive rebase. That is, pretty much all day. If you don't have a usable editor configured here, then you can't make a commit unless you supply the commit message with -m.
git config --global color.ui auto
git config --global merge.defaulttoupstream true
git config --global push.default simple
If you have an editor that creates temp files, or maybe a Mac with its infernal .DS_Store, you can list those in a file somewhere and then tell git to read that file and exclude everything you listed.
git config --clobal core.excludesfile $HOME/.gitexcludes