Bitbucket repo clone with login credentials

21,453

You can, with:

git clone https://user:[email protected]/myacc/app.git

But this will save your credentials in the origin url in .git/config.
To avoid that you could change the origin afterwards
git remote set-url origin https://[email protected]/myacc/app.git

Share:
21,453

Related videos on Youtube

Jon not doe xx
Author by

Jon not doe xx

Updated on July 09, 2022

Comments

  • Jon not doe xx
    Jon not doe xx almost 2 years

    I have a Basic git clone command to bitbucket in which I have to add Login credentials, is it possible to add Login credentials to a bitbucket git clone command?

    https://[email protected]/myacc/app.git
    

    Something like this?

    https://[email protected]/myacc/app.git -Password "123"
    
  • Jon not doe xx
    Jon not doe xx over 5 years
    Do I Need to add the Project Name if in the git remove command if I start like this?git clone https://user:[email protected]/myacc/app.git MyApp so should it be this? git remote set-url origin https://[email protected]/myacc/app.git MyApp
  • ColdIV
    ColdIV over 5 years
    It should work the way I posted it. The project should already be included in the URL.
  • Jon not doe xx
    Jon not doe xx over 5 years
    Ok thanks it seems to work, can you explain me this further I do not understand why this is an issue But this will save your credentials in the origin url in .git/config.
  • ColdIV
    ColdIV over 5 years
    It does not have to be an isse.<br/>In your projects local .git folder is a config file, and whoever has access to this file will then have your credentials, as it stores the origin url in it. But if you are the only one on your PC with access to this file, then there is no issue.
  • Marinos An
    Marinos An over 4 years
    What if password contains a @ ?
  • Genki
    Genki about 4 years
    @MarinosAn You can type %40 for @. More info: fabianlee.org/2016/09/07/…