这就是我所做的:
a
a
添加回子模块To https://git***.com/*******/***.git
! [rejected] Alpha -> Alpha (non-fast-forward)
error: failed to push some refs to 'https://git***.com/*******/***.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. If you want to integrate the remote changes,
hint: use 'git pull' before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
git pull upstream Alpha
来拉From https://git***.com/*******/***.git
* branch Alpha -> FETCH_HEAD
error: The following untracked working tree files would be overwritten by checkout:
- Some files in folder `a`
Aborting
error: could not detach HEAD
经过搜索,发现下面的方法不起作用以及对应的性能:
$ git status
On branch Alpha
nothing to commit, working tree clean
$ git submodule status
7f6cf82534ccb90380643673c87fca6716b60d3d Python (heads/main)
我想了解我需要做什么才能使推/拉正常工作。
尝试以下操作:
git submodule deinit [submodule name]
rm [module directory name]
git submodule update --init
git pull
除了步骤 3,尝试使用与之前(在远程)相同的远程路径和本地名称重新添加模块:
git submodule add [old submodule remote path] [old submodule directory name]