Where to find / create a .git / config file for local configuration for a project?

I want to know how I can create / find the .git / config file for my project, since windows do not allow me to put "/". Also, is it a file or is it a folder?

Is there a difference between .gitconfig and .git / config?

+4
source share
4 answers

Yes, there is a difference between .gitconfigand .git/config.

.git/configwill contain configuration information for your repository. But it .gitconfigwill contain your user data and the configuration set for git, for example user.name, the user.emaildefault editor, color settings, etc.

On Windows, you will find the file .gitconfigin C:\Users\user_name.

.git/config <git_repository>/.git/ (.git/config git init ).

+7

.gitconfig - , HOMEDIR.

.git - git, "".

.git - config, .

.gitconfig/.git/config git config.

: git config user.name "Jane Doe" user.name .git/config

git config --global user.email "jane.doe@example.com" user.email .gitconfig , . ( --global)

mysysgit . Cygwin !

!

+2

.gitconfig git . .git, , .

Windows msysgit, cmd Git.

0

In fact, Git stores configuration parameters in three separate files, which allows you to use the scope parameters for individual repositories, users, or the entire system:

  • repo / .git / config - settings for the repository

  • ~ / .gitconfig - User Preferences

    Parameters set with the -global flag are stored here.

    git config --global user.name "Love"

    git config --global user.email love@example.com

  • $ (prefix) / etc / gitconfig - System-wide settings.

0
source

All Articles