Git Setup: Your Name & Email

Git Tutorial

Are you a developer eager to optimize team collaboration through Git, but unsure how to set it up? This guide will take you through the steps of setting up Git, including how to input your name and email for easier collaboration.

Key Insights:

  • Git is a tool that aids developers in collaborative work, allowing them to track who has worked on a file.
  • To set up Git, access the command line through Terminal.app on Mac or Git Bash app on Windows.
  • Enter your name using the command "git config --global user.name "Your Name"", replacing "Your Name" with your actual first and last name. Ensure to keep the quotes around your name.
  • Enter your email using the command "git config --global user.email "you@example.com"", replacing "you@example.com" with your actual email address. Ensure to keep the quotes around your email.
  • Keep in mind that changing the name and email in Git will only affect future work, not past work.
  • To check the name or email currently set in Git, run the commands "git config --global user.name" and "git config --global user.email" without a value in quotes.

This exercise is excerpted from Noble Desktop’s Git & GitHub training materials and is compatible with updates through 2022. To continue learning web development with hands-on training, check out our coding bootcamps in NYC and live online.

Essential Git Commands

  • git status

    What's changed, staged, and untracked — your most-used command.

  • git diff

    See exactly what's different before staging.

  • git log

    Inspect commit history with --oneline or --graph for visualization.

  • git reset

    Undo staging or commits — careful with --hard.

Setting up Git

Git helps you to work with other developers. Because you want to know who worked on a file and how to contact them, you must tell Git your name and email.

Tell Git Your Name & Email

  1. To access the command line, do the following instructions for your platform:

    • Mac: Go to Applications > Utilities and open Terminal.app.
    • Windows: Launch the Git Bash app, which may be an icon on your Desktop, or in the Windows Start menu (probably in a Git folder).
  2. Enter the following command, replacing Your Name with your actual first and last name (but keep the quotes around it):

    Git config—global user.name "Your Name"

  3. Enter the following command, replacing you@example.com with your actual email (but keep the quotes around it):

    Git config—global user.email "you@example.com"

Full-Stack Web Development Certificate: Live & Hands-on, In NYC or Online, 0% Financing, 1-on-1 Mentoring, Free Retake, Job Prep. Named a Top Bootcamp by Forbes, Fortune, & Time Out. Noble Desktop. Learn More.

Keep in mind that changing the name and email will only affect future work.

Checking Your Git Setup (Name & Email)

To check the name or email currently set in Git, you can run the same commands, but without the value in quotes. So you’d use these commands:

Git config—global user.name
Git config—global user.email

Learn more in these courses

How to Learn Git

Master Git with hands-on training. Git is a free, open-source version control system that allows developers to track the changes they make to code.

Yelp Facebook LinkedIn YouTube Twitter Instagram