0 votes
1 view
in Devops and Agile by (20k 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 (28.4k 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 !


Categories

...