You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Clone my repo as origin ryanf55/ardupilot with --recurse-submodules at hash 5c1ed96
Change directory into ardupilot
Add an "upstream" remote of ardupilot/ardupilot
Fetch upstream
Rebase origin on upstream
Congrats, the work tree is hosed
Attempted recovery
git submodule deinit --all --force
git clean -dxf
git reset --hard origin/master
./Tools/gittools/submodule-sync.sh
git reset --hard upstream/master
$ git reset --hard upstream/master
fatal: not a git repository: ../../.git/modules/modules/lwip
error: Submodule 'modules/lwip' could not be updated.
error: Submodule 'modules/lwip' cannot checkout new HEAD.
fatal: Could not reset index file to revision 'upstream/master'.
ryan@B650-970:~/Dev/tmp_ws/ardupilot$ git rebase upstream/master
fatal: not a git repository: ../../.git/modules/modules/lwip
fatal: could not reset submodule index
error: could not detach HEAD
@Ryanf55 I've now reproduced. The key step which you didn't call out in the description is "git config submodule.recurse true". If you don't do that then it all works fine.
I've never set that config option myself, and just use --recurse when I want that (I often don't)
@Ryanf55 I've now reproduced. The key step which you didn't call out in the description is "git config submodule.recurse true". If you don't do that then it all works fine. I've never set that config option myself, and just use --recurse when I want that (I often don't)
Thanks for looking at this and reproducing the issue!
I'll create a Wiki PR to recommend turning off the submodule.recurse locally in the ArduPilot repo. ^
Bug report
Issue details
When using git submodules, when they are moved around, it causes major issues when switching branches.
Version
Start with HEAD at 5c1ed96 then try rebase on f67d895
git version: 2.34.1
OS of Ubuntu 22.04.3
Platform
[x ] All
[ ] AntennaTracker
[ ] Copter
[ ] Plane
[ ] Rover
[ ] Submarine
Steps to reproduce
Attempted recovery
Logs
Full logs to reproduce this are attached.
log.txt
The exact error occurs here:
Recommendations
OR
References
The text was updated successfully, but these errors were encountered: