Merge error after converting Git submodule to subtree

后端 未结 4 1348
时光说笑
时光说笑 2021-02-07 05:36

I have a project where I was originally using submodules for some dependent code. It turns out that submodules are not really appropriate for this project (and they are hard to

4条回答
  •  后悔当初
    2021-02-07 06:25

    You can't get git-merge (or any other command) to forcibly clobber files it doesn't think it knows about, no. git tries pretty hard not to do anything totally irreversible.

    But with many submodules, you can make your deletion a bit easier and safer with git submodule foreach:

    $ git submodule foreach 'rm -rf $toplevel/$path'
    Entering 'sub'
    $ git merge origin/branch
    Updating a231acd..6b4d2f4
    Fast-forward
    ...
    

提交回复
热议问题