中国制造网怎么注册,智能优化网站,企业信息查询系统官网湖南,免费中文网站模板下载git 子仓库
主仓库中添加子仓库
git submodule add url path更新子代码代码
git submodule update --init克隆含有子仓库的仓库
git clone --recurse-submodules url主仓库中删除子仓库
1、进入包含子仓库的父仓库的根目录
2、使用以下命令将子仓…git 子仓库
主仓库中添加子仓库
git submodule add url path更新子代码代码
git submodule update --init克隆含有子仓库的仓库
git clone --recurse-submodules url主仓库中删除子仓库
1、进入包含子仓库的父仓库的根目录
2、使用以下命令将子仓库从父仓库中移除解除关联
git submodule deinit submodule_path、
3、使用以下命令从 Git 仓库中删除子仓库的记录
git rm submodule_path
4、执行 git commit 来提交父仓库的修改
git commit -m Remove submodule submodule_path
5、最后删除实际的子仓库文件。你可以手动删除相关的子目录或者使用以下命令删除子仓库目录
rm -rf submodule_path子仓库 push 提交到 gerrit 出现没有 change-id ?
由于子仓库在 clone 后仓库的 .git 目录中没有 hook/commit-msg 工具 所以在生成的 commit message 中不会自动增加change-id 这会导致 commit 无法 push 到 gerrit上走 review 的流程
请使用以下方法增加 commit-msg tool 到子仓库的 .git 目录中
cd awk {printf $2} .git/hooks
wget http://192.168.0.202:8002/tools/hooks/commit-msg
chmod x commit-msg
cd -对于没有 change-id 的 commit 可以使用 git commit --amend 或者 git rebase -i 重新增加 change-id 有了 change-id 后即可以顺利 push
拉取子仓库时避免重复输入用户名和密码
git config --global http.postBuffer 524288000在父仓库根目录中执行
git submodule update --remote该命令会根据 .gitmodules 中每个子仓库的分支同步至远程仓库对应分支的最新节点。 所以请确保 .gitmodules 每个子仓库的分支名是正确的