Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git pull/clone with username and password in AWS Code Commit

I Need to do a git pull using https url as a oneline command . this command I need to integrate in a bash script . But all the time it is asking the usernmae and password .

The repository is in AWS codecommit

like image 980
Tony Jose Avatar asked Oct 19 '17 05:10

Tony Jose


People also ask

Where do you set up Git credentials of AWS CodeCommit?

To set up HTTPS Git credentials for CodeCommit Sign in to the AWS Management Console and open the IAM console at https://console.aws.amazon.com/iam/ . Make sure to sign in as the IAM user who will create and use the Git credentials for connections to CodeCommit.


2 Answers

Try this:

git clone https://username:[email protected]/v1../repos../..

This way worked for me for CodeCommit (AWS) repository

like image 192
Gavriel Cohen Avatar answered Oct 05 '22 22:10

Gavriel Cohen


Check this link: Enter user password in command

As is described perfectly in that post, you basically have three options:

  1. Store the password in .netrc file (with 600 permissions). Make sure you clone the repo specifying the username in the url.
  2. Clone the repo with https://user:pass@domain/repo . Take into account that your password will be visible in several places...
  3. Use the credential helper.
like image 31
Jorge Avatar answered Oct 05 '22 20:10

Jorge