Explore Courses Blog Tutorials Interview Questions
0 votes
1 view
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:[email protected]

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:[email protected]@remote.git

git clone [email protected]:[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

Welcome to Intellipaat Community. Get your technical queries answered by top developers!

28.4k questions

29.7k answers


94.1k users

Browse Categories