What does git "added by us" mean?

11,047

"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.

Share:
11,047

Related videos on Youtube

chrisjleu
Author by

chrisjleu

Updated on August 01, 2022

Comments

  • chrisjleu
    chrisjleu over 1 year

    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

  • BoiseBaked
    BoiseBaked about 7 years
    I should mention this. Sometimes "git rebase" just screws up a cherry-pick and you have to skip it by doing git rebase --skip.