Heroku拉私人github存储库 [英] Heroku pull private github repository

查看:164
本文介绍了Heroku拉私人github存储库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试了不同的方法在Rails应用程序 Gemfile 中使用Github私有存储库引用。

  1)Gemfile:
gem'my_gem',::git => https://#{github_user}:#{github_pw} @ github.com / me / my_gem.git

'git push heroku'的结果:

 获取https:// user:pw@github.com/me /my_gem.git 
错误:请求的URL在访问https:// user:pw@github.com/me/my_gem.git/info/refs
时返回错误:401 Git错误:命令`git克隆'https:// user:pw@github.com/me/my_gem.git'/tmp/build_2wxmqutch8gy7/vendor/bundle/jruby/1.9/cache/bundler/git/my_gem-929bddeee3dd4a564c2689e189190073df01431e--bare --no目录/ tmp / build_2wxmqutch8gy7中的-hardlinks失败。
安装的依赖项

然后我发现这篇文章 https://help.github.com/articles/creating-an-oauth-token-for

  2)Gemfile:
gem'命令行使用
并创建了一个OAuth令牌。 my_gem',:git => https://#{github_oauth_token} @ github.com / me / my_gem.git

结果from'git push heroku':

 获取https://0123456789abcdef0123456789abcdef01234567@github.com/me/my_gem.git 
密码:

Heroku暂停并提示输入密码。



在我的本地机器上:

  git clone https:// user:pw@github.com/me /my_gem.git 

  git clone https://0123456789abcdef0123456789abcdef01234567@github.com/me/my_gem.git 

works perfekt!

本地:

 #git --version 
git version 1.7.9.5

Heroku:

 #heroku run git --version 
git version 1.7.0


解决方案

Heroku的git(版本1.7)不支持使用电子邮件作为用户名Github的存储库。



您必须使用您的Github用户名。

另外,Heroku的git不支持使用oauth token。



希望Heroku能够很快升级他们的git,这样他们可以继续让我的生活更轻松: - )


I have tryed different approaches to use a Github private repository reference in a Rails application Gemfile.

1) Gemfile:
gem 'my_gem', :git => "https://#{github_user}:#{github_pw}@github.com/me/my_gem.git"

Result from 'git push heroku':

Fetching https://user:pw@github.com/me/my_gem.git
error: The requested URL returned error: 401 while accessing https://user:pw@github.com/me/my_gem.git/info/refs
Git error: command `git clone 'https://user:pw@github.com/me/my_gem.git' "/tmp/build_2wxmqutch8gy7/vendor/bundle/jruby/1.9/cache/bundler/git/my_gem-929bddeee3dd4a564c2689e189190073df01431e" --bare --no-hardlinks` in directory /tmp/build_2wxmqutch8gy7 has failed.
Dependencies installed

Then I found this article https://help.github.com/articles/creating-an-oauth-token-for-command-line-use and created an OAuth token.

2) Gemfile:
gem 'my_gem', :git => "https://#{github_oauth_token}@github.com/me/my_gem.git"

Result from 'git push heroku':

Fetching https://0123456789abcdef0123456789abcdef01234567@github.com/me/my_gem.git
Password:

Heroku stall and prompt for a password.

On my local machine both:

git clone https://user:pw@github.com/me/my_gem.git

and

git clone https://0123456789abcdef0123456789abcdef01234567@github.com/me/my_gem.git

works perfekt!

Local:

# git --version
git version 1.7.9.5

Heroku:

# heroku run git --version
git version 1.7.0

解决方案

Heroku's git (version 1.7) doesn't support using e-mail as username for Github's repositories.

You must use your Github username.

Also, Heroku's git doesn't support using an oauth token.

Hopefully Heroku will upgrade their git soon, so they can continue making my life easier :-)

这篇关于Heroku拉私人github存储库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆