-1

I have python app and want to clone git repo. I need to write "git clone", enter "username" and "password". How to do it?

git clone https://github.com/user/awesomerepo.git
username: login
password: password

upd: I want to clone private repos and because I rly need to input usr/pass :)

PersianGulf
  • 2,845
  • 6
  • 47
  • 67
prozac631
  • 57
  • 1
  • 2
  • 7
  • I would suggest you do something like [this](https://pythonhosted.org/GitPython/0.3.1/tutorial.html) instead. – rlms Mar 02 '14 at 10:49

1 Answers1

2

If you really want to clone via the Git CLI through Python like this, you could use the subprocess module (see Calling an external command in Python) to issue a command like:

git clone https://user:password@github.com/user/awesomerepo.git

See How to provide username and password when run "git clone git@remote.git"?.

You are probably better off using a dedicated Git interaction library for Python, though. See Python Git Module experiences?.

Community
  • 1
  • 1
Daniel Andersson
  • 1,614
  • 1
  • 14
  • 23