,

How to do git clone without installing git in WSL (Windows Subsystem for Linux)

Posted by

In this Article i m going to share the step by step guide to git clone in Windows Subsystem for Linux Ubuntu server.

First of all one of the major question is raised that is installing git is necessary to git clone in Windows Subsystem for Linux Ubuntu server.
Answer is –

No, installing Git within the Windows Subsystem for Linux (WSL) is not required in order to clone a Git repository. Without installing it within WSL, you may use Git via a GUI client or the Windows command prompt.

Nevertheless, you may install Git within WSL to clone repositories and carry out Git activities directly in that environment if you want to work in the Linux environment that WSL offers. If you wish to utilize Linux commands and tools, this could be useful.

How to clone git repository is WSL (Windows Subsystem for Linux) ?

Step – 1 : First go to the directory where you want to clone the git repo.

Step – 2 : you can directly run the git clone command if your ssh key is already set in the git hub.

git clone git@github.com:git-repo-for-your-project.git

These are the only steps for the git clone.

If your SSH key is not set in your github then follow the below process.

How to add SSH Key in your github in WSL (Windows Subsystem for Linux)?

Here are the steps to add your SSH Key in your github in WSL.

Step – 1 : Go to your root directory.

Step – 2 : Run this command to generate your ssh key for your github account.

ssh-keygen -t rsa -b 4096 -C "your_email@example.com"

Step – 3 : Run the command as follow, and then add the SSH key to the ssh-agent:

eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_rsa

Step – 4 : Copy the contents of the public key (id_rsa.pub) to your clipboard:

cat ~/.ssh/id_rsa.pub

Step – 5 : Activate the duplicated key on your GitHub profile. Add a new SSH key by going to your GitHub account settings, selecting “SSH and GPG keys,” and then finish.

Step – 6 : Run the Below command to verify the connection to github:

ssh -T git@github.com

Step – 7 : Run your git clone command to clone any repo from github in WSL (Windows Subsystem for Linux).

8 responses

  1. Amit Kumar Avatar
    Amit Kumar
  2. Maruti Kumar Avatar
    Maruti Kumar
  3. Rajesh Avatar
    Rajesh
  4. Dolly K Avatar
    Dolly K
  5. Anup rajak Avatar
    Anup rajak

Leave a Reply

Your email address will not be published. Required fields are marked *

8
0
Would love your thoughts, please comment.x
()
x