Setup & Configuration
git version→ Display the installed version of Gitgit help <command>→ Get help for a specific commandgit config --global user.name "Your Name"→ Set your username globallygit config --global user.email "your@email.com"→ Set your email globallygit config --list→ View all configurations
git version
Syntax : git version
- Description: The git version command is used to display the currently installed version of Git on your system.
- Usage: It helps verify installation, check compatibility, and troubleshoot issues when working with repositories.
- Think Tank: While git version is the most common usage, Git provides related flags:
| Command | Description |
|---|---|
git --version |
Prints installed Git version |
git -v |
Short form, same as --version |
git help |
Displays help information |
- Best Practices:
- Always run git --version after installation or upgrade
- Keep Git updated to the latest stable release for security and performance
- Document Git version in project setup guides to ensure team consistency
- In CI/CD, log Git version for reproducibility and environment details
Git - git Documentation

git help
Usage : git help [options] [<command>|<doc>]
Example : git help, git help merge, git help git- Description: Displays help information about Git itself or specific Git subcommands.
- Usage: Running git help with no arguments shows a synopsis of Git and a list of commonly used commands.
- Think Tank: The git help command has multiple options to customize how documentation is displayed:
| Option | Description |
|---|---|
-a / --all |
Show all available Git commands |
-g / --guides |
Show Git concept guides (e.g., branching, workflows) |
-c / --config |
Show help for configuration variables |
-m / --man |
Open documentation in the system’s man page viewer |
-i / --info |
Open documentation in GNU info viewer |
-w / --web |
Open documentation in a web browser |
--aliases |
Show command aliases if defined |
- Best Practices:
- Use
git help <command>whenever unsure about syntax or options - Explore guides (
git help -g) to understand Git concepts beyond commands - Prefer
-woption if you find web-based documentation easier to read - Keep Git updated so your local documentation matches modern features
- Use
Git - git-help Documentation

git config
Syntax : git config [options] [section.key] [value]
User Identity:
git config --global user.name "Shubham Sihasane"
git config --global user.email shubhamsihasane@example.com
Default Editor:
git config --global core.editor "vim"
Aliases:
git config --global alias.st status
git config --global alias.co checkout- Description: The
git configcommand is used to set, get, and manage Git configuration variables that control Git’s behaviour. - Usage: It allows you to customize Git at the system, global, and local repository levels, covering identity, editor preferences, line endings, aliases, and advanced workflows.
- Think Tank: Git supports three levels of configuration, applied in order of precedence:
| Level | Scope | File Location |
|---|---|---|
| System | Applies to all users on the machine | /etc/gitconfig |
| Global | Applies to a single user | ~/.gitconfig or ~/.config/git/config |
| Local | Applies only to a specific repository | .git/config inside the repo |
👉 Precedence: Local > Global > System. If the same variable is set at multiple levels, the local value overrides global, which overrides system.
| Option | Description |
|---|---|
--list |
Show all current configurations. |
--get |
Retrieve value of a specific key. |
--unset |
Remove a configuration entry. |
--edit |
Open configuration file in editor. |
- Best Practices:
- Always set user.name and user.email before committing
- Use global aliases to speed up workflow
- Configure line endings properly to avoid cross-platform issues
- Regularly check with
git config --listto ensure consistency - Avoid storing passwords directly; use credential helpers or SSH keys
Git - git-config Documentation


Updated on Dec 19, 2025