How To Override Git Configurations in Windows?

The task to override git configurations is simple. All you need to be aware of is what configurations you would like to do. But before that you need to setup git in your machine.

Read here how to setup git configurations in windows

Location of default git configuration file

During first time Windows installation configuration parameters are set by default.  Usual path of config file is at C:\ProgramData\Git\config. Unhide ProgramData folder. It does not have any extension.

Below are default values of my configuration file:

To see the status of git configuration file execute below command:

$ git config – -list

Config parameters stores different values. Any change in git file will be reflected after execution of git command as shown below:

GitConfigStatus

Override git configuration parameters

In the config file let us override parameter help.format=html.

Find below the syntax to get help for any command:

$ git help {command name}

The HTML help for init will be opened in browser by this command.

GitHelpInit

As discussed in previous article How to install and setup git in Windows git config –global command is used to set user name and user email. I will use the same command to override help.format key.

$ git config – -global help.format txt

As you can see in below image the help.format key is overridden.

Git Configurations Oerride Format

Location of Overriding git configuration file

We executed the command “git config – -global help.format txt” and overridden the key of “help.format“. The file which has overridden git configurations parameters is “C:\Users\Ankit\.gitconfig” file. Below are contents of my “.gitconfig” file.

You can directly edit this file and override or modify the git configuration keys.

How to know git configuration key’s value

In order to check the value of a particular key. you need to execute below command :

$ git config {key name}

If I execute command “git config help.format” value “txt” is output. See below image:

Git Configurations Key Value

Hope you like the article. We highly appreciates comments and feedback.

You can also Subscribe here to stay updated on latest posts of OracleMine.com.

 

Leave a Reply

Your email address will not be published. Required fields are marked *