I want to know how I can create/find a .git/config file for my project, as windows does not allow me to put the "/". Also, is this a file or is it a folder?
Is there a difference between .gitconfig and .git/config?
On windows this file can be found at C:\Documents and Settings\All Users\Application Data\Git\config on Windows XP, and in C:\ProgramData\Git\config on Windows Vista and newer.
The Git configuration file contains a number of variables that affect the Git commands' behavior. The . git/config file in each repository is used to store the configuration for that repository, and $HOME/. gitconfig is used to store a per-user configuration as fallback values for the .
Yes, there is difference between .gitconfig
and .git/config
.
.git/config
will have the configuration details of your repository. But .gitconfig
will have your user details and the configuration you set for git like user.name
, user.email
, default editor, color setting, etc.
In Windows, you will find the .gitconfig
file in C:\Users\user_name
.
.git/config
file can be located under <git_repository>/.git/
(.git/config
gets created once you run git init
command or you clone an initialized repository).
.gitconfig
is a global configuration file that resides in your HOMEDIR.
.git
is your special directory in any git repo that makes it a 'repo'.
Inside .git is a file called config
that applies all the configurations mentioned in it to that particular repository only.
You can add configurations to either .gitconfig/.git/config using the git config
command.
Eg:
git config user.name "Jane Doe"
adds a user.name entry in your current repository's .git/config file
git config --global user.email "[email protected]"
adds a user.email entry in your users .gitconfig file, and it will be applicable to all repos under that users.
(Note use of --global)
Using mysysgit has a lot of benefits. Cygwin is also a good option!
Cheers!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With