Try the following command:
git rebase --onto <remote>/<branch-name> $(git rev-list HEAD \ --not --exclude=$(git rev-parse --symbolic-full-name HEAD) \ --glob=refs
This will only rearrange the commits that were made in the current local branch.
If you want to include local changes in other branches that have not been clicked, change the expression --glob=refs/* to --remotes . Keep in mind, although you can promote these local branches in the future, so use them with caution.
Explanation: Of course, since you are not using git pull , you will need to do git fetch before rebooting. (I prefer git fetch + git rebase or git merge , so that I can control what I rebuild or merge.)
Joseph K. Strauss
source share