我正在使用 Play Framework 2.0 和 Dojo 1.8 启动一个项目,并将使用 Git 进行版本控制。我想知道将 Dojo 文件与我的项目一起进行版本控制是否是一个好习惯,因为它是一个巨大的库。
最佳答案
GitHub上有Dojo官方只读镜像:https://github.com/dojo 。将 dojo、dijit、dojox 和 util 作为子模块添加到项目存储库中:
# 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
这是我前段时间遇到同样问题时得到启发的两个 stackoverflow 答案:
与上述一起,我雇用了 A successful Git branching model ,这很棒,但设置起来有点棘手。如果您有兴趣,我可以添加如上所述的分步说明。
关于git - 与项目一起对依赖项进行版本控制,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12533106/