What is Git?
Git is a free and open-source distributed version control system (VCS) designed to handle everything from small to very large projects with speed and efficiency.
It allows you to track changes to your files over time, so you can revert to specific versions, compare changes, and collaborate with others on the same project without overwriting each other's work.
Why Use Git?
- Track History: See every change made to your project, by whom, and when.
- Collaborate: Work with a team seamlessly. Git helps merge changes from multiple people.
- Branching: Safely experiment with new features on "branches" without affecting the main project.
- Revert Mistakes: Easily undo changes or go back to a previous, working state.
- Industry Standard: Git is the most widely used VCS in software development.
Install Git
The easiest way to install Git on Windows is to use the official installer:
- Download the latest Git for Windows installer from git-scm.com.
- Run the installer and follow the on-screen prompts. The default settings are recommended for most users.
- This will install Git Bash (a command-line tool), the Git GUI, and shell integration.
- Verify installation by opening a new terminal (Git Bash or Command Prompt) and typing:
git --version
5.Alternative Method (using winget):
If you have the winget package manager installed, you can install Git with this command:
winget install --id Git.Git -e --source winget
Install winget tool if you don't already have it, then type this command in Command Prompt or PowerShell.