git username passwo...
Notifications
Clear all

git username password-How do I provide a username and password when running “git[email protected]”?

RSS

(@ganesh)
Noble Member
加入:2年ago
Posts: 1362
20/05/2021 12:53 pm

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

git clonehttps://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.


Quote
(@anamika)
Noble Member
加入:2年ago
Posts: 1381
20/05/2021 12:54 pm

The following can be used:

$ git clonehttps://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 clonehttps://[email protected]/username/repository.git


ReplyQuote
Share:
Baidu