1. Setup and Configuration
git --versionWhat it doesChecks Git installation and current version number
When to use itAfter installation or to ensure certain features are supported
Example
git --versiongit config --global user.name "Your Name"What it doesdisplays or sets the author name associated with all commits
When to use itWhen setting up the development environment for the first time
Example
git config --global user.name "Mustafa Masoud"git config --global user.email "you@example.com"What it doesDisplays or sets the author email address
When to use itto link your contributions to your GitHub account
Example
git config --global user.email "dev@example.com"git config --list --show-originWhat it doesDisplays all applied settings along with the path to each setting file
When to use itto track settings conflicts between System, Global and Local
Example
git config --list --show-origin
2. Creating and Cloning Repositories
git initWhat it doesStarts a new local Repository and prepares the .git folder
When to use itWhen starting a new project from scratch locally
Example
mkdir my-app && cd my-app && git initgit clone <url>What it doesCopy a locally existing Repository with the full history of changes
When to use itto download a project from GitHub or remote server
Example
git clone https://github.com/user/repo.gitgit clone --depth 1 <url>What it doesShallow clone to the last commit just to save time and space
When to use itIn CI/CD pipelines or for quick loading of large projects
Example
git clone --depth 1 git@github.com:user/repo.git