开发者

How to get a particular branch of github project in one line command

Let's say that I have a rails plugin called "wipy" on GitHub. It has a master branch and it has production branch. I am using Rails 2.3.10.

I need to install production branch of this plugin. This is what I do currently:

git clone git://github.com/nadala/demo.git
git co -b production origin开发者_高级运维/production
cp -rv wipy ~/my_project/vendor/

I could do:

ruby script/plugin install git://github.com/nadal/wipy.git 

However I do not know how to pass an indicator that I want production branch.

I tried following but it did not work:

ruby script/plugin install git://github.com/nadal/wipy.git  --branch production


Would this blog post help?

Recently I needed to install the Rails 2.3 stable version of the exception notification plugin and so I needed to specify a particular branch in the git repository.

script/plugin install git://github.com/rails/exception_notification.git -r 2-3-stable

The -r option allows you to identifiy the specific branch you're after.

In your case:

ruby script/plugin install git://github.com/nadal/wipy.git  -r production


ruby script/plugin install git://github.com/nadal/wipy.git 
cd vendor/plugins/wipy
git checkout production
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜