Initial Git Configuration
After installing Git, it's important to configure it with your personal information. Follow the steps below:
Setting your username
Run the following command in your terminal, replacing "Your Name" with your actual name:
git config --global user.name "Your Name"
Setting your email
Run the following command, replacing the email with your actual address:
git config --global user.email "your.email@example.com"
Verifying your configuration
To verify that the settings were applied correctly, use:
git config --list
This will display all Git settings, including the ones you just defined.
Setting the default editor
You can configure the default text editor Git will use. For example, to set Visual Studio Code as the default editor:
git config --global core.editor "code --wait"
Replace code with the command for your preferred editor if different.
Setting the default branch name
Modern Git uses main as the default branch name. To configure this globally:
git config --global init.defaultBranch main