0% found this document useful (0 votes)
83 views12 pages

Git Config Guide for Developers

This document summarizes various commands for configuring Git such as git config -l to list configuration variables, git config --edit to edit configuration files, git config --global to set global user configuration like email and name, and git config --local to set repository-specific configuration. It also covers using git config to set username and password, setting the default branch, replacing or removing configuration values, and preventing repeated username/password prompts.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as ODP, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
83 views12 pages

Git Config Guide for Developers

This document summarizes various commands for configuring Git such as git config -l to list configuration variables, git config --edit to edit configuration files, git config --global to set global user configuration like email and name, and git config --local to set repository-specific configuration. It also covers using git config to set username and password, setting the default branch, replacing or removing configuration values, and preventing repeated username/password prompts.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as ODP, PDF, TXT or read online on Scribd

Github Config

09/07/2023 1
--list
● List all variables set in config file.
● git config -l
● git config --list

09/07/2023 2
--edit
● Opens an editor to modify the specified config file; either --
system, --global, or repository (default).
● git config --edit
● git config --global --edit
● git commit --amend --reset-author

09/07/2023 3
--global
● For reading options: read only from global ~/.gitconfig and
from $XDG_CONFIG_HOME/git/config rather than from all
available files.

● git config --global [Link] "you@[Link]"


● git config --global [Link] "Your Name"
● git config --global [Link] "your password"

09/07/2023 4
--global 2nd method
● git config [--global] [Link] "Your Name"
● git config [--global] [Link] "email@[Link]"
● git config [--global] [Link] "Your Password"

09/07/2023 5
--local
● For writing options: write to the repository .git/config file.
This is the default behavior.
● For reading options: read only from the repository .git/config
rather than from all available files.

● git config --local [Link] "you@[Link]"


● git config --local [Link] "Your Name"
● git config --local [Link] "your password"

09/07/2023 6
config-file
● git config [Link] "you@[Link]"
● git config [Link] "Your Name"
● git config [Link] "your password"

09/07/2023 7
github asking for username and password on
every push
● github asking for username and password on every push
● git config --global [Link] store

09/07/2023 8
Config Branch
● git config --global [Link] <name>
● git config --global [Link] main

09/07/2023 9
--replace-all
● Default behavior is to replace at most one line. This replaces
all lines matching the key (and optionally the value_regex).

● git config --global --replace-all [Link] "Your New Name"


● git config --global --replace-all [Link] "Your new email"

09/07/2023 10
--unset
● Remove the line matching the key from config file.

● git config --global --unset [Link]


● git config --global --unset [Link]
● git config --global --unset [Link]

09/07/2023 11
--unset-all
● Remove all lines matching the key from config file.

● git config --global --unset-all [Link]


● git config --global --unset-all [Link]
● git config --global --unset-all [Link]

09/07/2023 12

You might also like