git rebase --continue no changes
If I understand correctly, when you're getting the merge conflict, you're accepting all the changes from branch_1
, meaning that that particular commit from branch_2
is irrelevant - any changes in that commit are identical to the incoming changes from branch_1
.
When git is saying
No changes - did you forget to use 'git add'?
it's telling you that the commit you're trying to apply doesn't make any changes to the repo, and therefore there's no reason for it to exist.
The simple solution to that is git rebase --skip
, which just says "ignore this commit and move on" as suggested in @C-Otto's comment. This will skip the commit you're currently dealing with, and move on to subsequent ones.
You might also find it easier to use interactive rebasing (git rebase -i
), which first presents you with a list of the commits it will apply, and gives you various options for what to do with each individual commit. In this case, if you identify a commit that is no longer relevant, you can skip it up-front, so you'll never see the conflict in the first place.
Related videos on Youtube
![Paul](https://i.stack.imgur.com/ux2t5.png?s=256&g=1)
Paul
Updated on June 06, 2022Comments
-
Paul about 2 years
I have two branches with two features:
banch_1
andbranch_2
.branch_2
uses feature frombranch_1
. I've made changes in thebranch_1
and want to rebasebranch_2
onbranch_1
to get changes frombranch_1
intobranch_2
.So, I'm checking out on branch_2:
git checkout branch_2
And trying to rebase on branch_1:
git rebase branch_1
After that I get 'Merge conflict' for two files. So I run
git mergetool -t meld
and resolving that conflicts, choosing changes from
branch_1
.I'm saving files and going to terminal, typing
git status
and see that there is no changes in git index. Next I rungit rebase --continue
and gettingNo changes - did you forget to use 'git add'?
error. But there is nothing to add! I type
git log
and see commit frombranch_1
but there is no commit frombranch_2
.What I'm doing wrong?
-
C-Otto over 8 yearsDid the mergetool step create a commit? When I do a rebase, I just stage a resolved conflict (using
git add
), but do not create a commit. In your case agit rebase --skip
might help? -
Paulo Bu over 8 yearsIt would help some output after each step, and the git status output after the merge.
-