How to rebase when it says that current branch is up to date even though it isn't?
In my case --force-rebase
helped. I guess, in your case it would be:
git checkout b
git rebase --force-rebase a
maxhallinan
Updated on July 20, 2022Comments
-
maxhallinan over 1 year
I rebased my branch which had the effect of putting some commits on top of my own. Then realized I had forgotten to squash some commits, so hard reset and squashed. Now I need to bring those commits back. But rebasing again tells me that the current branch is up to date, even though it isn't. Is there a way to fix this?
Edit:
There are two branches: a and b. Both are branched from master. Both are up to date with master. Branch a has some changes. I want branch b to have those changes too. I rebased branch a on to b. The latest commit was from branch a. I meant to squash the three commits before that commit. I hard reset to before the latest commit. Then I squashed. Now I want to get back that latest commit in a way that won't cause headaches when the time comes to merge branch b to master.
I've tried
reflog
andgit reset --hard HEAD@{n}
but same problem: Current branch is up to date. -
matt over 3 yearsDon’t answer the same question multiple times please.
-
Nurio Fernández over 3 years@matt they are different options, not a duplication.