Issue
username = rohan Password = rohan!@#$ clonerepourl = https://[email protected]/scm/~vy381y/dcae_ms_status.git MyDir = C://python//Rohan
I want to write python code to clone this repo to MyDir . Please help . I tried below but didnt helped . git clone https://rohan:rohan!@#$@https://[email protected]/scm/~vy381y/dcae_ms_status.git
Solution
First: Try to get de exactly command that you put in your console when you try to clone a repository: For example:
git clone https://username:[email protected]/username/repository.git
Then you can use the system
module in order to perform that command:
from os import system
username = "rohan"
password = "rohan!@#$"
command_to_run = "git clone https://" + username + ":"+password+ "@github.com/"+username+"/repository.git"
system(command_to_run)
Answered By - ljuk