search
Search
Login
Unlock 100+ guides
menu
menu
web
search toc
close
Comments
Log in or sign up
Cancel
Post
account_circle
Profile
exit_to_app
Sign out
What does this mean?
Why is this true?
Give me some examples!
search
keyboard_voice
close
Searching Tips
Search for a recipe:
"Creating a table in MySQL"
Search for an API documentation: "@append"
Search for code: "!dataframe"
Apply a tag filter: "#python"
Useful Shortcuts
/ to open search panel
Esc to close search panel
to navigate between search results
d to clear all current filters
Enter to expand content preview
icon_star
Doc Search
icon_star
Code Search Beta
SORRY NOTHING FOUND!
mic
Start speaking...
Voice search is only supported in Safari and Chrome.
Navigate to

Git settings configuration

schedule Aug 12, 2023
Last updated
local_offer
Tags
mode_heat
Master the mathematics behind data science with 100+ top-tier guides
Start your free 7-days trial now!

It is possible to check and change Git settings using the git config command.

There are three types of settings:

Type

Scope

Location

Notes

system

All repositories for every user on this computer.

/etc/gitconfig

-

global

All repositories of a particular user

~/.gitconfig

Directly below home

local

A specific repository

repository/.git/config

Under .git of the repository

Settings take precedence in the following order: local, global, system. For example, if the same setting is configured in both system and local, the value of local will be used.

You can view the list of all configurable settings from the official documentation: https://git-scm.com/docs/git-config.html#_variables

A few examples include:

  • color.ui: controls Git output color coding (set to auto by default)

  • core.editor: editor used for editing commit messages

Checking settings configuration

Single variable

You can check the current configuration for each variable using the following command:

git config <name>

where <name> refers to the name of the variable you would like to check the configuration for.

For example, to check the current configuration for the core.editor variable:

git config core.editor

To check the configuration at a particular level (local, system, global):

git config --local core.editor
git config --global core.editor
git config --system core.editor
NOTE

As local is a per repository setting, the --local option is only valid when the command is run within the repository.

All configured variables

To display all configured variables and their values that are enabled at the place where the command is executed:

git config -l
credential.helper=osxkeychain

Again, it is possible to just check the configurations at a particular level (local, system, global):

git config --local -l
git config --global -l
git config --system -l

Modifying settings configuration

To change the configuration of a particular variable:

git config <name> <value>

where:

  • <name> refers to the name of the variable you would like to check the configuration for

  • <value> refers to the new value to set for the variable

By default, running the above command will change the local configurations.

To change the global, system configurations of a particular variable:

git config --global <name> <value>
git config --system <name> <value>
robocat
Published by Arthur Yanagisawa
Edited by 0 others
Did you find this page useful?
thumb_up
thumb_down
Comment
Citation
Ask a question or leave a feedback...
thumb_up
0
thumb_down
0
chat_bubble_outline
0
settings
Enjoy our search
Hit / to insta-search docs and recipes!