The Wayback Machine - https://web.archive.org/web/20240118175146/https://www.geeksforgeeks.org/how-to-install-git-on-windows-subsystem-for-linux/
Open In App
Related Articles

How to Install Git on Windows Subsystem for Linux?

Improve
Improve
Improve
Like Article
Like
Save Article
Save
Report issue
Report

Git is an open-source distributed version control system developed to handle everything from simple to complex projects with performance and speed. Git software allows a team or group of developers to work together, with all using the same files and folders. It gradually reduces the confusion that tends to happen when multiple people are editing the same files. Git is a cross-platform software that works with various operating systems. So, in this article, we will be installing the Git software on Windows Subsystem for Linux/Ubuntu operating system.

Note: Make sure you have installed WSL for Linux or Ubuntu on your main Windows System.

Installing Git on WSL(Windows Subsystem for Linux)

To install the Git on WSL(Windows Subsystem for Linux) we have to follow the following steps:

Step 1: First of all we have to launch Windows Terminal Preview or Power-shell on Windows machine and open the Linux or Ubuntu terminal.

Open-terminal

Step 2: Now, add the repositories by using the following command.

sudo add-apt-repository ppa:git-core/ppa

Adding-repositories

Step 3: Now, we will update the Linux system using the given command 

sudo apt-get update -y

Update-the-linux-system

Step 4: Now we use the following command to install the Git package in WSL.

sudo apt-get install git

Installing-Git-package

Verifying installation of Git on WSL(Windows Subsystem for Linux)

To verify if the Git has been successfully installed in your system run the below command in Terminal:

git –version

You’ll get the following output if the installation of Git is completed successfully in your system.

Verifying-installation-of-Git

Learn to code easily with our course Coding for Everyone. This course is accessible and designed for everyone, even if you're new to coding. Start today and join millions on a journey to improve your skills!

Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out - check it out now!

Commit to GfG's Three-90 Challenge! Purchase a course, complete 90% in 90 days, and save 90% cost click here to explore.
Last Updated : 11 Feb, 2022
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads
Complete Tutorials