Rebase in a temp worktree when the main tree has others' uncommitted work
If you must rebase your local commits onto a moved remote while the primary working tree holds a collaborator's uncommitted edits (some in files the remote also changed), avoid git pull --rebase --autostash: a stash pop conflict can tangle their work. Instead: git worktree add --detach <tmp> HEAD, rebase there onto origin/main, resolve conflicts, run the tests (set PYTHONPATH to the worktree so it does not import the primary tree), and push with git push origin HEAD:main. Then in the primary tree, back up the uncommitted work twice (git stash store -m ... $(git stash create) and git diff --binary > patch), git reset --hard origin/main, git apply --3way patch, and git reset to unstage. Hunks the remote already contains apply cleanly and disappear from the diff. Remove the worktree afterwards.