我一直在尝试在 Heroku 上引入一些经过身份验证的 git 存储库,但遇到了一些问题。
理想情况下,我希望能够使用令牌解决方案在这里 https://github.com/blog/1270-easier-builds-and-deployments-using-git-over-https-and-oauth git pull https://<token>@github.com/username/bar.git
甚至是一个git pull https://username:[email protected] /cdn-cgi/l/email-protection/username/bar.git
如果令牌解决方案不可接受,则解决方案是可接受的。
然而,heroku 版本的 git (v1.7.0) 似乎与 https 验证的克隆作斗争:
$ heroku run bash
$ git --version
git version 1.7.0
$ git clone https://username:[email protected] /cdn-cgi/l/email-protection/username/bar.git
Initialized empty Git repository in /app/bevry-website/.git/
error: The requested URL returned error: 401 while accessing https://username:[email protected] /cdn-cgi/l/email-protection/username/bar.git/info/refs
fatal: HTTP request failed
在heroku实例上安装较新版本的git(v1.7.12)并使用它可以正常工作:
$ 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:[email protected] /cdn-cgi/l/email-protection/username/bar.git
works fine :)
然而,在实例上安装我们自己的 git 版本并不理想,因为编译和安装需要很长时间。
Heroku 似乎不提供任何免费支持,这很不幸,因为我只需要告诉他们升级他们的 git 版本,一切都很好。然而,由于这是不可能的,有没有人对在heroku上进行经过身份验证的https git克隆有任何建议? (我已经通过上传一个特殊的文件来获得经过身份验证的 ssh.ssh
目录与存储库,但这对于我们的情况并不理想,因为我们更愿意只使用 https 和令牌)。