Let's say I'm working on my local repository, and commit often while editing a single file - brandNewFile.txt
. So before starting, in the original commit we have just one line of text: "It's a nice day"
.
Now we add one line at the end of the file, consisting of just the "generic1"
text, and create a new commit (A).
This is repeated once more, with a "generic2"
line, resulting in commit B.
We've ended up with 2 new commits (A and B).
Now before pushing to the remote repository, where everyone has access, I decide that I'd like to cleanup a bit the history, and just keep what I consider to be the meaningful commits related to the operation I was doing.
So I'll do a rebase starting at the original commit, but drop A, while applying (pick) B. As soon as the rebase starts, the following output comes out, following application of B:
Unmerged paths:
(use "git reset HEAD <file>..." to unstage)
(use "git add <file>..." to mark resolution)
both modified: brandNewFile.txt
no changes added to commit (use "git add" and/or "git commit -a")
Why would there be a conflict reported, when all I'd like is for one commit that appends one line of text to be placed "on top" of an already existing commit ?
To me it's not a merge operation being attempted, although the outcome sure seems to suggest that this is what's going on.