Stop using git stash and instead use temporary commits.
By doing that there is nothing special handling, just straight forward, normal git commands:
git commit -am "==== before pull ====" # Temporary commit
git pull --rebase
git reset HEAD^ # Undo temporary commit
In case of conflicts, use KDiff3 to resolve them.
The above is as simple as it gets. Alternatively if you want a bit more control (say pull
brings in a lot of changes and you only want to deal with some of it at the beginning) you could work with two branches, somebranch
(which is tracking origin/somebranch
) and somebranch.mywork
which is the unpublished work you are doing.
Then you let somebranch
strictly follow origin/somebranch
and then rebase somebranch.mywork
on top of that. When you eventually want to push changes from somebranch.mywork
you simply (fast-forward) merge those changes into somebranch
and push.