git删除submodule

来源:互联网 发布:好友生日提醒软件 编辑:程序博客网 时间:2024/05/22 12:58

local为本地库文件夹,remote为远程库所在的文件夹,libopencm3为库中含有的submodule

cd remote

git init --bare


cd local

vi .gitmodules
rm -rf .git/modules/
vi .git/config
cd libopencm3/find ./|grep git/ delete
git add .gitmodules
git commit -m "delete submodule"
git rm --cached libopencm3
cd libopencm3/find ./|grep git/ delete
git add libopencm3
git commit -m "add libopencm3"
git remote add xx /home/robot/gittest/remote
git push xx "src branch":"desc branch"


从远程仓库拉下代码来测试一下


原创粉丝点击