1. Download Git for Windows
- Go to the official site: https://git-scm.com/download/win
- The download should start automatically. You’ll get an installer like
Git-<version>-64-bit.exe.
2. Run the Installer
- Double-click the downloaded
.exefile. - Accept the license agreement.
3. Choose Installation Options
The installer has several configuration screens. The defaults work fine for most users, but here are the key points:
- Select Components → leave defaults checked.
- Choosing the editor → pick your preferred editor (default is Vim; many people choose Notepad++ or VS Code if installed).
- Adjusting your PATH environment → select “Git from the command line and also from 3rd-party software” (recommended).
- SSH transport backend → select “Use SSH”.
- Line ending conversions → select “Checkout Windows-style, commit Unix-style line endings” (default).
- Terminal – Use the therinal in VS Code or Powershell, or whatever other shell you installed. You must restart VS Code after installing for it to work.
- Leave the rest as default unless you know you need a specific option.
Click Install.
4. Verify Installation
- Open Command Prompt, PowerShell, or Windows Terminal.
- Type:
git --version - If Git installed correctly, it will show the version number (e.g.,
git version 2.46.0.windows.1).
5. Configure Git
Set your global username and email:
git config --global user.name "Your Name"
git config --global user.email "you@example.com"
Code language: PHP (php)
Check your settings with:
git config --list
Code language: PHP (php)
