E.g. I have a feature
branch based on master
with 1 new commit with 2 added files.
commit hash1
A test.html
A test.png
Now I want to rebase this feature
branch on master
to get the latest code. Since I started working on feature
branch 1 new commit in master
was added.
commit hash2
A test.html
When I'm executing the git rebase master
I got this output.
First, rewinding head to replay your work on top of it...
Applying: Initial commit.
Using index info to reconstruct a base tree...
M test.html
Falling back to patching base and 3-way merge...
error: The following untracked working tree files would be overwritten by merge:
test.html
Please move or remove them before you can merge.
Aborting
Failed to merge in the changes.
Patch failed at 0001 Initial commit.
The copy of the patch that failed is found in:
/<path>/.git/rebase-apply/patch
When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".
As the result changes from feature
completely negated, test.html
is the version from master
and the test.png
was not added at all.
How to resolve this situation?