Setup and Config

git config [<file-option>] [--type=<type>] [--fixed-value] [--show-origin] [--show-scope] [-z|--null] <name> [<value> [<value-pattern>]]
git config [<file-option>] [--type=<type>] --add <name> <value>
git config [<file-option>] [--type=<type>] [--fixed-value] --replace-all <name> <value> [<value-pattern>]
git config [<file-option>] [--type=<type>] [--show-origin] [--show-scope] [-z|--null] [--fixed-value] --get <name> [<value-pattern>]
git config [<file-option>] [--type=<type>] [--show-origin] [--show-scope] [-z|--null] [--fixed-value] --get-all <name> [<value-pattern>]
git config [<file-option>] [--type=<type>] [--show-origin] [--show-scope] [-z|--null] [--fixed-value] [--name-only] --get-regexp <name-regex> [<value-pattern>]
git config [<file-option>] [--type=<type>] [-z|--null] --get-urlmatch <name> <URL>
git config [<file-option>] [--fixed-value] --unset <name> [<value-pattern>]
git config [<file-option>] [--fixed-value] --unset-all <name> [<value-pattern>]
git config [<file-option>] --rename-section <old-name> <new-name>
git config [<file-option>] --remove-section <name>
git config [<file-option>] [--show-origin] [--show-scope] [-z|--null] [--name-only] -l | --list
git config [<file-option>] --get-color <name> [<default>]
git config [<file-option>] --get-colorbool <name> [<stdout-is-tty>]
git config [<file-option>] -e | --edit
  • Check Git configuration

git config [--global | --local] --list
  • Edit Git Configuration

git config --global --edit
  • Configure Git Key/Values

git config [--local | --global | --system] <key> [<value>]
  • Store Credentials in the cache

git config --global credential.helper cache

commit.template

  • Specify the pathname of a file to use as the template for new commit messages.

git config [--global | --local] commit.template ~/.gitcommitmessage
.gitcommitmessage
## jira issue number
JIRA-

## Describe your changes

core.longpaths

  • to override the file path too long error.

git config --system core.longpaths true

Configure tooling

  • Check Git configuration

git config --list
  • Edit Git Configuration

git config --global --edit
  • Configure Git Key/Values

git config [--local | --global | --system] <key> [<value>]
  • Store Credentials in the cache

git config --global credential.helper cache
git config --global fetch.prune true

This removes local branches that have been removed from the remote when doing a fetch or pull.

Last updated