Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in DevOps and Agile by (19.4k points)
edited by

I know how to provide a username and password to an HTTPS request like this:

git clone https://username:password@remote

But I'd like to know how to provide a username and password to the remote like this:

git clone [email protected]

I've tried like this:

git clone username:password@[email protected]

git clone git@username:[email protected]

git clone [email protected]@username:password

But they haven't worked.

1 Answer

0 votes
by (27.5k points)

The following can be used:

$ git clone https://username:[email protected]/username/repository.git

You can also leave out the password, after the following command git will ask you and it will not be saved in .git/config nor in your bash history

$ git clone https://[email protected]/username/repository.git

Browse Categories

...