在Mercurial子存储库中使用特定的(git)分支

nst*_*tus 5 git mercurial branch subrepos mercurial-subrepos

我有一个商业项目,我想在其中使用jQuery-File-Upload。我在.hgsub文件中添加了以下内容,以便为此插件创建子仓库:

public/assets/common/js/filedrop = [git]git://github.com/blueimp/jQuery-File-Upload.git
Run Code Online (Sandbox Code Playgroud)

我的问题是我需要jquery-ui在项目中的此git repo 的分支中使用。

有什么方法可以指定一个git repo的分支名称来提取为hg subrepo吗?

nst*_*tus 4

我自己发现的。

事实上你不需要做任何特别的事情。在编辑添加子存储库并克隆它之后,您所要做的.hgsub就是将目录更改为该存储库,签出所需的分支或版本并使用 Mercurial 提交。

就我而言,整个过程是(在终端中):

$ echo "public/assets/common/js/jQuery-File-Upload = [git]git://github.com/blueimp/jQuery-File-Upload.git" >> .hgsub
$ cd public/assets/common/js/
$ git clone git://github.com/blueimp/jQuery-File-Upload.git
$ cd jQuery-File-Upload
$ git checkout jquery-ui
$ hg commit -m"ADDED: jQuery-File-Upload subrepo (jquery branch)"
Run Code Online (Sandbox Code Playgroud)