Blog
How to set up your global (and local) Git profile
Every new machine needs this before the first commit, and I always forget the exact commands. Here they are.
Set up your Git profile
- Open your favorite terminal
- Set your Git username
$ git config --global user.name "Tony Stark"
- Set your Git email
$ git config --global user.email [email protected]
- Set your Git editor (optional)
$ git config --global core.editor nano
# you can also use emacs (nostalgic) or vim (adventurous).
# If you don't set one, Git uses $EDITOR, or vi.
- Review your settings
$ git config --list --show-origin
The
--globalflag applies the settings to your user on this computer. To set them for one project only, go to the project’s root folder (where the.gitfolder is) and run the samegit configcommands without--global, or with--localto be explicit.