Installing Git on Windows
What is a Version Control System?
A version control system (VCS) helps you track changes in files over time. Imagine you're working on a document and making edits but later realize you preferred an earlier version. With VCS, you can easily jump back to previous versions or compare changes without losing any of your work.
VCS is also known as revision control or source control.
What is Git?
In software development, Git becomes the default VCS for most projects. It enables teams to collaborate on large projects efficiently. It allows multiple developers to work on different parts of the same project without overwriting each other's work. Git manages and merges everyone's contributions seamlessly.
Let’s say you’re part of a team building a web app. Developer A is responsible for building the login page, and Developer B is working on the profile page. With Git, both developers can work on these features simultaneously in their own branches. Once they’ve finished, Git merges their work together. This approach prevents conflicts and ensures smooth collaboration.
Installing Git
1. Download Git for Windows
Visit the official Git website and click the download button.
2. Run the Installer
Once the download is complete, locate the setup file (typically in your Downloads folder) and run it.
3. Accept the Agreement
Review the terms of the license agreement. Click Next.
4. Select Destination Location
Choose the directory where you want to install Git or leave it as the default location. Click Next.
5. Select Components
Keep the default options checked. Click Next.
6. Select Start Menu Folder
Keep the default folder name (i.e., Git) or change it if desired. Click Next.
7. Choosing the Default Editor Used by Git
Select the option "Use Visual Studio Code as Git's default editor." Click Next.
8. Adjusting the Name of the Initial Branch in New Repositories
Keep the default, "Let Git decide." This option sets your initial branch name to master
. Click Next.
9. Adjusting Your PATH Environment
Keep the default, "Git from the command line and also from third-party software." Git will be added to your system PATH. This option allows you to run the git
command in any terminal, such as Git Bash, Command Prompt, or PowerShell. It also makes Git available to third-party software that depends on It (e.g., IDEs like Visual Studio Code).
Click Next.
10. Choosing the SSH Executable
Keep the default, "Use bundled OpenSSH." OpenSSH allows you to connect securely to remote repositories (like GitHub, GitLab, or Bitbucket) via SSH rather than HTTPS. SSH is often preferred by developers because it allows password-less authentication using SSH keys.
Click Next.
11. Choosing HTTPS Transport Backend
Keep the default, "Use the OpenSSL library." When you connect to remote repositories via HTTPS (rather than SSH), Git uses SSL/TLS to encrypt the communication and ensure security.
Click Next.
12. Configuring Line Ending Conversions
Keep the default, "Checkout Windows-style, commit Unix-style line endings." This option manages line endings in text files, which differ between Windows and Unix-based systems (like Linux and macOS). This setting ensures that line endings are handled consistently across different platforms, preventing issues when collaborating with others who use different operating systems.
Click Next.
13. Configuring the Terminal Emulator to Use with Git Bash
Keep the default, "Use MinTTY (the default terminal of MSYS2)." MinTTY provides a Linux-like experience and is more feature-rich compared to cmd.exe.
14. Choose the Default Behavior of "git pull"
Keep the default, "Fast-forward or merge." This option determines how Git handles the git pull
command by default.
Fast-foward: You pull from a remote repository where there are new changes. If your local branch has no new changes, Git simply moves your pointer forward.
Merge: If you have made local changes, Git merges the remote updates with your local work and may create a new merge commit if necessary.
Click Next.
15. Choose a Credential Helper"
Keep the default, "Git Credential Manager." A credential helper stores and manages your credentials (username and password) when interacting (e.g., pushing or pulling) with remote repositories. The Git Credential Manager will be our credential helper.
16. Configuring Extra Options
Keep the default, "Enable File System Caching." By caching file system data, Git doesn't have to recheck the file system every time a command is run. This improves performance, especially for larger repositories or projects with many files.
17. Configuring Experimental Options
Do not select anything since you may add new features that are unstable.
18. Install
Click the Install button to begin the installation process.
19. Launch Visual Studio Code
Once installation is complete, you can launch Git by checking the Launch Git Bash box and clicking Finish.