15

I am trying to clone a private git repository via http. There is a similar question here: Git clone using http with user and password.

Is there a way to do git clone without entering a user/password at the prompt?

When I try and do:

prodroom15:mquimiro$ git clone https://github.com/user:password/Automator.git
Cloning into 'Automator'...
Username for 'https://github.com': 
Password for 'https://github.com': 

How would I do this so that I don't have to type in the user/password manually?

Note that doing the normal https://github.com/user/Automator.git and manually entering in the user/password at the prompt works fine.

1 Answer 1

21

I think the syntax is actually https://user:[email protected] not https://github.com/user:password.

If you are using Git 1.7.9 or later, consider using the more secure credential helper mechanism.

3
  • Thanks, the case was reversed syntax.
    – David542
    Commented Nov 8, 2012 at 22:24
  • just a quick not that the full url would then be something like this https://user:[email protected]/user/myrepo.git
    – Sverre
    Commented Mar 20, 2015 at 10:29
  • What happens (in terms of security) if I use http instead of https?
    – variable
    Commented Jul 14, 2022 at 5:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.