github项目与子模块克隆capistrano [英] github project with submodules cloning capistrano

查看:349
本文介绍了github项目与子模块克隆capistrano的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为一个拥有子模块的git项目构建一个capistrano deplyoment脚本。



运行这些命令

 运行git clone git @ github.com:GITPROJECT / var / www / myfolder

当我运行这个子模块时不会克隆到/ var / www / myfolder,它只创建一个带有子模块名称的空文件夹



当我尝试运行它时,它不会工作

 运行cd / var / www / myfolder / submodule&& git pull master
pre>

有人可以帮我解答吗?你需要的是

$ p $ set:git_enable_submodules,1

选项在 deploy.rb 脚本中。它告诉capistrano在从主repo获取源文件后初始化并更新git子模块。如果由于某种原因需要手动执行,可以从项目的根目录运行:

  git submodule update  - -init 

虽然如果我没有记错, - init 在一些旧版本的git中不可用,所以如果它不起作用,你可以这样做:

  git submodule init&& git submodule update 

查看这个答案,以获得更多有关capistrano的git选项的详细解释。


i am trying to build a capistrano deplyoment script for a git project which has a submodule.

I am running these commands

run "git clone git@github.com:GITPROJECT /var/www/myfolder"

when i run this the submodule wont clone to /var/www/myfolder instead it only creates an empty folder with the name of the submodule

when I try to run this it wont work either

run "cd /var/www/myfolder/submodule && git pull master"

can someone help me with this please ?

解决方案

Basically what you need is

set :git_enable_submodules, 1

option in your deploy.rb script. It tells capistrano to init and update git submodules after fetching source from the main repo. If for some reason you want to do it manually you can run that from the root directory of your project:

git submodule update --init

though, if I remember correctly, --init is not available in some older versions of git so if it doesn't work you can do it like that:

git submodule init && git submodule update

Have a look at this answer for more extensive explanation about git options for capistrano.

这篇关于github项目与子模块克隆capistrano的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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