Blog

How to set up your global (and local) Git profile

  • git
  • tutorial
  • devjournal

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 --global flag 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 .git folder is) and run the same git config commands without --global, or with --local to be explicit.

Resources

Also on dev.to

Loading the terminal…