You use git worktrees, and then merge-in. Or rebase, or 3-way merge, as necessary.
I have a local application I developed that works extremely well for this. I.e. every thread tied to a repo creates it's own worktree, then makes it edits locally, and then I sync back to main. When conflicts occur, they are either resolved automatically if possible (i.e. another worktree merged into main first, those changes are kept so long as they don't conflict, if conflicted we get the opportunity to resolve, etc.).
At any merge-into-main from a worktree, the "non-touched" files in the worktree are automatically re-synced to main, thus updating the worktree with any other changes from any other worktree that have been already pushed to main.
Of course, multiple branches can also be used and then eventually merged into a single branch later..
---
Also, this is very clearly exactly the same thing OP does in their system, as per the README on their github link..
I have a local application I developed that works extremely well for this. I.e. every thread tied to a repo creates it's own worktree, then makes it edits locally, and then I sync back to main. When conflicts occur, they are either resolved automatically if possible (i.e. another worktree merged into main first, those changes are kept so long as they don't conflict, if conflicted we get the opportunity to resolve, etc.).
At any merge-into-main from a worktree, the "non-touched" files in the worktree are automatically re-synced to main, thus updating the worktree with any other changes from any other worktree that have been already pushed to main.
Of course, multiple branches can also be used and then eventually merged into a single branch later..
---
Also, this is very clearly exactly the same thing OP does in their system, as per the README on their github link..