Created
June 19, 2020 16:31
-
-
Save Syzygianinfern0/b4d3193f80fd05dfaba3c12f85787d6d to your computer and use it in GitHub Desktop.
Clone Private Repos on Headless Machines
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from getpass import getpass | |
import urllib | |
user = input('User name: ') | |
password = getpass('Password: ') | |
password = urllib.parse.quote(password) # your password is converted into url format | |
repo_name = input('Repo url: ').split("https://")[1] # https://github.com/Syzygianinfern0/WAV2TEXT.git | |
cmd_string = 'git clone https://{0}:{1}@{2}'.format(user, password, repo_name) | |
os.system(cmd_string) | |
cmd_string, password = "", "" # removing the password from the variable |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment