After a git rebase
I have merge conflicts to solve. I'm confused by the meaning of "added by us" on A.java
. What prevents it being automatically added/staged as a new file like C.java
?
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
new file: com/company/C.java
Unmerged paths:
(use "git reset HEAD <file>..." to unstage)
(use "git add <file>..." to mark resolution)
added by us: com/company/A.java
both modified: com/company/B.java
git version 2.5.1.windows.1
For some conflict notifications, Git will include a "Deleted by us" or "Deleted by them" message next to a file. That means that you modified a file in one branch and deleted it in another. Git has no way of knowing if you want to delete the file or modify it, so you need to make the choice yourself.
"git rebase" is clunky and obtuse, but oh so useful. To summarize what I think is going on in your case, a rebase "merge conflict" is produced by the "both modified". You have to pick which mod you want - the "com/company/B.java" mods on their branch, the mods on your branch or some combo of both. The "added by us:" is telling you that "com/company/A.java" is new to your branch and was brought in by the branch you're rebasing against. But due to the way git implements rebase, "us" is really their branch. Not sure if this is counted as a rebase "merge conflict" unless you deleted "com/company/A.java" on your branch, the target of the rebase. In that case, that would be a rebase "merge conflict" that you would have to solve. To resolve such a "merge conflict," remember "us" is really their branch and "theirs" is really your branch. Blah.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With