Configuring git

upon downloading the git into the local machine we need to configure the GitHub details to global environment.

git --version

Configuring git :

git config --global user.name "Vishvam Anjaria"

Here we have configured the name for my global config setting over github

git config --global user.email "vkanjaria56@gmail.com"

& to list all the configs done we can check it with

git config --list

De-registering global configs :

1. Remove the Global Git Configuration File

You can delete the Git global configuration file directly. The file is typically located at ~/.gitconfig.

rm ~/.gitconfig

2. Unset Specific Global Configuration

If you just want to reset specific settings (like username or email), you can use the git config --global --unset command.

For example, to reset the global username:

git config --global --unset user.name

To reset the global email:

git config --global --unset user.email

3. Reset All Global Configurations

If you want to reset all global configurations, you can simply use:

git config --global --unset-all

Note: This command can be a bit more aggressive and may affect more than just user information.

4. Check Global Config

After resetting, you can check the current global configuration with:

git config --global --list

Last updated