Reputation: 2567
I wish to clone the Git repo using ssh URL using shell script as a part of automation.
So need to pass the username and password in the clone command.
How to pass the username and password in the same line.
For HTTP/HTTPS based URL I have passed the username, password in the clone command in the script, it works fine. But for ssh based URL it is not.
General SSH based clone command which I'm using:
git clone ssh://{user}@{host}:{port}/{repo}
Upvotes: 1
Views: 4415
Reputation: 2567
sshpass -p password git clone ssh://{user}@{host}:{port}/{repo}
Upvotes: 2