You can use “git config -add” flag to add a new config in git config file.
Example:
Create a new git local repository:
1 2 |
## Create a new git repository git init mydir && cd mydir |
Add your user.name and user.email details in git configuration file:
1 2 3 |
## Add a new configuration in git config file git config --add --local user.email cloudaffaire@gmail.com git config --add --local user.name cloudaffaire |
Observe: We have used –local flag to add the configuration in git local configuration file. If you want to add the configuration in git global or system configuration file, use –global or –system flag respectively.
List the git configuration that you just added:
1 2 3 |
## List git local config for user git config --local --get-regexp "user*" ## use --global or --system for global and system configurations |
Remove your local git repository:
1 2 |
## remove local repository directory cd .. && rm -rf mydir |