0

I'm trying to git clone a remote repository by using a simple bash script, but I could not get pass the prompt where github asks for my username and password. Here is my condensed version of the script:

#!/bin/bash
REPO=$1
USERNAME=$2
PASSWORD=$3
git clone $REPO
expect "Username for 'https://github.com':"
send $USERNAME

The send command does not seem like it is passing the USERNAME variable because the prompt never get pass the "Username for 'https://github.com':"

I tried piping and heredoc methods without any luck. Any help is gladly appreciated.

Thanks!

Anthony
  • 149
  • 7

1 Answers1

0

You can include credentials in the git push command like so:
git push https://<USER>:<PASS>@github.com/asdf/blah.git
I hope this helps; let me know if this doesn't work.
jBit

jBit
  • 31
  • 1
  • 9