it:ad:git:howto:configure_git

IT:AD:Git:HowTo:Configure Git

Configuration settings are read hiearchically, by looking for a config file within the current repository, falling back to .gitconfig file in %userprofile%.

Typing:

git config --global user.name "John Doe"
git config --global user.email johndoe@example.com

Will (optionally create and) use a .gitconfig file in %userprofile% containing:

[user]
	name = Sky
        email = skysigal@xact-solutions.com

The --global switch determines whether the new settings are in the common config, or the current repo.

To see what are the current settings, use git config --list:

C:\Users\Sky>git config --list --global

user.name=Sky
user.email=skysigal@xact-solutions.com

To see all settings – global and local repo:


C:\Users\Sky>git config --list

core.symlinks=false
core.autocrlf=false
color.diff=auto
color.status=auto
color.branch=auto
color.interactive=true
pack.packsizelimit=2g
help.format=html
http.sslcainfo=/bin/curl-ca-bundle.crt
sendemail.smtpserver=/bin/msmtp.exe
diff.astextplain.textconv=astextplain
rebase.autosquash=true
user.name=Sky
user.email=skysigal@xact-solutions.com

C:\Users\Sky>

To check a single key value:

git config user.name

  • /home/skysigal/public_html/data/pages/it/ad/git/howto/configure_git.txt
  • Last modified: 2023/11/04 01:43
  • by 127.0.0.1