How to use SSH Instead of HTTPS for Git Remote URLs In GIT

For any GitHub repository, you have two methods to clone. You need to switch to the SSH method instead of HTTPS to solve this issue.

For this go to your Github repo and Hit the Code button after that select the SSH tab. You will see the SSH URL you can just copy it.

Refer to the image below for reference.

Now to switch from https to SSH you can go to the terminal in your local machine and run the following command.

git remote set-url origin git@github.com:CoderSaty/FirstProjects.git

How to Fix Git Always Asking for User Credentials?

Git is a powerful version control system but one of the common problems faced by most of the developers is that they are prompted to enter username and password every time they try to interact with Github. As we all know there are two ways to clone a repository HTTPS and SSH. This problem generally occurs when we clone the repository using the HTTPS method. It can be very frustrating to enter the username and password again and again. In this article, we will see how we can solve this problem. There are several methods to solve this issue, we will go through each one of them.

Similar Reads

Using SSH Instead of HTTPS for Git Remote URLs

For any GitHub repository, you have two methods to clone. You need to switch to the SSH method instead of HTTPS to solve this issue....

Store your git credentials

Go to your terminal and your repository folder and you can run the command given below. This command will store your password permanently. The credentials are stored in plain text in a file (~/.git-credentials) which is not very secure. The –global flag ensures that the credentials are stored for all the repositories for that user and not just the current repository....