Skip to content

Instantly share code, notes, and snippets.

@Syzygianinfern0
Created June 19, 2020 16:31
Show Gist options
  • Save Syzygianinfern0/b4d3193f80fd05dfaba3c12f85787d6d to your computer and use it in GitHub Desktop.
Save Syzygianinfern0/b4d3193f80fd05dfaba3c12f85787d6d to your computer and use it in GitHub Desktop.
Clone Private Repos on Headless Machines
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