How to show git config parameters and values
To display the current Git configuration settings, you can use the git config --list command. This command will show a list of all the configuration settings that are currently applied, including those set at the system, global, and local levels.
Here's how you can view your Git configuration:
Viewing Git Configuration Settings
-
Open your terminal or command prompt.
-
Run the following command:
git config --listThis will list all the settings available, showing their key-value pairs. For example, you might see settings like user name, email, default text editor, etc.
Example Output
Here's an example of what the output might look like:
user.name=Your Name
[email protected]
core.editor=vim
core.autocrlf=input
color.ui=auto
Viewing Specific Configuration Levels
Git configuration settings can be applied at different levels: system, global, and local. You can specify which level to view by using the --system, --global, or --local option with the git config --list command.
-
System Level:
git config --list --systemThis shows settings for all users on the system. You might need administrator privileges to view this.
-
Global Level:
git config --list --globalThis shows settings for the current user.
-
Local Level:
git config --list --localThis shows settings specific to the current repository.
Editing Git Configuration
You can also edit Git configuration settings using the git config command. Here are a few examples:
-
Set user name:
git config --global user.name "Your Name" -
Set user email:
git config --global user.email "[email protected]" -
Set default text editor:
git config --global core.editor "vim"