gpt4 book ai didi

Git子模块在 checkout 时删除另一个分支

转载 作者:太空狗 更新时间:2023-10-29 13:51:35 25 4
gpt4 key购买 nike

我的 Git 存储库中有几个具有功能的分支。
每个功能都是一些外部存储库,作为子模块插入。
我应该怎么做才能更正分支之间的切换,有和没有子模块?

示例:

$ git init
$ git commit -m "empty" --allow-empty
$ git checkout -b feature
$ git submodule init
$ git submodule add git://feature.git feature
$ git commit -a -m "add feature"
$ git checkout master
warning: unable to rmdir feature: Directory is not empty

我们的 master 分支工作目录中有一个功能。
如何预防?

最佳答案

git submodule deinit .

可能会成功

关于Git子模块在 checkout 时删除另一个分支,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27265383/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com