对依赖项与项目进行版本控制



我正在使用Play Framework 2.0和Dojo 1.8启动一个项目,我将使用Git进行版本控制。我想知道将 Dojo 文件与我的项目一起版本化是否是一种好的做法,因为它是一个庞大的库。

GitHub 上有 Dojo 的官方只读镜像:https://github.com/dojo。将 dojodijitdojoxutil 作为子模块添加到您的项目存储库中:

# create project directory
mkdir MyProject
cd MyProject
# init git repository
git init
# add git submodule
mkdir src
git submodule add https://github.com/dojo/dojo.git src/dojo
# switch to the particular dojo version
# use `git tag` inside the submodule directory to list available versions 
cd src/dojo
git checkout 1.8.0
# repeat previous two steps for dijit, dojox, util (if necessary):
# https://github.com/dojo/dijit.git
# https://github.com/dojo/dojox.git
# https://github.com/dojo/util.git
# commit changes
cd ../..
git add .
git commit -m "added dojo submodule and moved it to the version 1.8.0"
# push if applicable

这是我前段时间遇到同样问题时受到启发的两个堆栈溢出答案:

  • 为远程设置外部 git回购
  • Git 子模块:指定分支/标签

与前面提到的一起,我采用了一个成功的 Git 分支模型,这很棒,但设置起来有点棘手。如果您有兴趣,我可以添加上述分步说明。

最新更新