0

I must add my user and pass github into the code. Is it possible? I mean I need to login every time I run the script but using the user and pass I have in the code:

code:

from git import Repo

def add_files():
    user = 'martinbouhier'
    pass = '123pass'
    repo_dir = 'python'
    if os.path.exists(repo_dir):
        shutil.rmtree(repo_dir)
    git_url = 'https://github.com/martinbouhier/python'
    Repo.clone_from(git_url, repo_dir)
    shutil.copy(file_klip, repo_dir)
    os.remove(file_klip)
    os.chdir(repo_dir)
    repo = Repo()
    commit_message = 'Actualizacion'
    repo.index.add([file_klip])
    repo.index.commit(commit_message)
    origin = repo.remote('origin')
    origin.push()
phd
  • 82,685
  • 13
  • 120
  • 165

0 Answers0