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
{{ message }}
Repository navigation
Pull with rebase fails when the upstream moved a submodule to a new commit #89
Pull with rebase fails when the upstream moved a submodule to a newer commit and the branch has local commits. The pull stops with:
unstaged changes exist in workdir; class=Rebase (29); code=Unmerged (-10)
The repository is left in the middle of a rebase, with HEAD detached. Continue rebase fails with the same error, so the only way out is to abort.
Expected: like git pull --rebase, the local commits are replayed on top of the upstream. Git leaves the submodule folder at its old commit and reports it as modified (M deps/lib) until you update it.
Likely cause: libgit2 checks the working tree again in rebase.commit() (rebase_commit_merge → rebase_ensure_not_dirty(…, false, true, GIT_EUNMERGED)). After the rebase checks out onto, the index records the submodule's new commit, but nothing updated the submodule folder. libgit2 therefore sees the submodule as an unstaged change and refuses every commit of the replay. git rebase doesn't treat the submodule that hasn't been updated yet as a change, which is why the same steps work there.
The same failure applies to a plain rebase onto any branch that moves a submodule's recorded commit, not only to a pull.
Steps to reproduce
Use a repository with an initialized submodule (for example at deps/lib) that is checked out at the recorded commit.
On the upstream, commit a new submodule commit (the submodule moves from lib one to lib two) and push.
Locally, make an unrelated commit (for example, edit README.md).
Choose Pull with rebase (or Pull with pull.rebase = true). It fails with the error above, and the toolbar shows a rebase in progress.
Choose Continue rebase. It fails with the same error.
The same steps with git pull --rebase (git 2.56) succeed. They end with local edit on top of bump lib, and git status shows M deps/lib.
I reproduced this through the engine functions the UI calls (remote::pull in rebase mode, then rebase_continue), using the test suite's submodule fixture, not by clicking through the app. The rebase code path is the same on main (0.26.0, 34126e1).
Activity
ChrisLauinger77 commentedon Nov 13, 2026
@cheat2001 I can have a look at this after #91 is merged it is OK for you