I've been trying to pull in some authenticated git repos on heroku, and hit a few problems.
Ideally, I'd love to be able to use the token solution here git pull https://<token>@github.com/username/bar.git
or even a git pull https://username:password@github.com/username/bar.git
solution is acceptable if the token solution isn't.
However, it seems heroku version of git (v1.7.0) struggles with https authenticated clones:
$ heroku run bash
$ git --version
git version 1.7.0
$ git clone https://username:password@github.com/username/bar.git
Initialized empty Git repository in /app/bevry-website/.git/
error: The requested URL returned error: 401 while accessing https://username:password@github.com/username/bar.git/info/refs
fatal: HTTP request failed
Installing a newer version of git (v1.7.12) onto the heroku instance and using that works fine:
$ heroku run bash
$ curl --silent --location http://git-core.googlecode.com/files/git-1.7.12.tar.gz | tar xz; cd git-1.7.12; make NO_TCLTK=YesPlease NO_PERL=YesPlease NO_GETTEXT=YesPlease NO_SVN_TESTS=YesPlease NO_MSGFMT=YesPlease NO_MSGFMT_EXTENDED_OPTIONS=YesPlease prefix=$HOME install; cd ..; rm -Rf git-1.7.12
$ ./bin/git --version
git version 1.7.12
$ ./bin/git clone https://username:password@github.com/username/bar.git
works fine :)
However, installing our own git version on the instance is not ideal as it takes a very long time to compile and install.
It seems that heroku does not offer any free support, which is unfortunte as I just need to tell them to upgrade their git version and all is good. However, as this is not possible, does anyone have any suggestions for doing authenticated https git clones on heroku? (I have managed to get authenticated ssh going by uploading a special .ssh
directory with the repo, however that is not ideal for our situation as we would prefer to just use https and tokens).