0 votes
in Git by
How to do git configuration to get or set various user options?

1 Answer

0 votes
by
When reading/getting, the values are read from the system, global and repository local configuration files by default, and options --system, --global, --local and --file <filename> can be used to tell the command to read from only that specific location. When writing, the new value is written to the repository local configuration file by default(--local), and options --system, --global, --file <filename> can be used to tell the command to write to that location.

Set a user's email-id (to be recorded in any newly created commits) : git commit --global user.email "[email protected]"

Set a user's full name (to be recorded in any newly created commits) : git commit --global user.name "Sandeep Choudhary"

Set signed key for a signed tag or commit : git config --global user.signingkey <your-signed-key-here> Command 'git config --global --list' will show all of the current global settings/options.

Configuration saved using '--global' is stored in a file '.gitconfig' in the current user's home directory. User's name and email-id should be set before using git further.

Related questions

0 votes
asked Mar 26, 2021 in Git by rajeshsharma
0 votes
asked Oct 16, 2019 in Git by rajeshsharma
...