Here is the current state of this feature branch.
Recent Steps:
Results:
$ git status
# On branch feature-foo-branch
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# modified: foo/bar.php
# modified: foo/baz.php
#
# Unmerged paths:
# (use "git reset HEAD <file>..." to unstage)
# (use "git add/rm <file>..." as appropriate to mark resolution)
#
# both modified: foo/conflict.php
#
and status with -s
$ git status -s
UU foo/conflict.php
M foo/bar.php
M foo/baz/php
git recommends either add
or rm
to resolve the conflict. What does UU
mean and why would those be the options to fix it?
All of the information I can find about resolving conflicts similar to this say not to use rm
which makes me wonder why git thinks it's appropriate.
I can't find anything about UU
in the git manual pages but there is this SO question which also seems to be having trouble sorting out why add
would work in this case.
U = updated but unmerged. So UU means: unmerged, both modified.
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.
The easiest way to add all files to your Git repository is to use the “git add” command followed by the “-A” option for “all”. In this case, the new (or untracked), deleted and modified files will be added to your Git staging area. We also say that they will be staged.
See git status
manual:
In the short-format, the status of each path is shown as XY PATH1 -> PATH2
For paths with merge conflicts, X and Y show the modification states of each side of the merge. For paths that do not have merge conflicts, X shows the status of the index, and Y shows the status of the work tree. For untracked paths, XY are ??
U = updated but unmerged
So UU means: unmerged, both modified
I think the add or rm message is a generic message for unmerged states, where the state can be like unmerged, both deleted
, unmerged, deleted by them
and so on, and hence the suggestion to rm
. That is why there is as appropriate
in the suggestion.
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