How to configure your username and email in Git?

To configure your username and email in Git, you can follow these steps:

  1. Open the command-line interface (CLI) or Git Bash.

  2. Start by setting your username using the following command:

    git config --global user.name "Your Name"

    Replace "Your Name" with your actual name enclosed in quotes.

  3. Next, set your email address using the following command:

    git config --global user.email "[email protected]"

    Replace "[email protected]" with your actual email address enclosed in quotes.

  4. Verify that the configuration was successful by running the following command:

    git config --global --get user.name git config --global --get user.email

    This will display your configured username and email respectively.

Now, whenever you commit your code, Git will associate the commit with your specified username and email.