What does git "added by us" mean?
"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.
Related videos on Youtube
chrisjleu
Updated on August 01, 2022Comments
-
chrisjleu over 1 year
After a
git rebase
I have merge conflicts to solve. I'm confused by the meaning of "added by us" onA.java
. What prevents it being automatically added/staged as a new file likeC.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
-
BoiseBaked about 7 yearsI should mention this. Sometimes "git rebase" just screws up a cherry-pick and you have to skip it by doing
git rebase --skip
.