0

I am working on an android project but i got this kind of conflict. I never met this before any clue which one should i keep?

<<< .merge_file_a36756
    @Inject
    TPOmnitureReporter reporter;

    private TPCardAdapter adapter;
=======
    private TPAdapter adapter;
>>>>>>> .merge_file_a32544

EDIT

My question is i am not quite sure which part of code is mine. Usually it should be <<< HEAD is my code. But it is .merge_file_a now.

William Hu
  • 15,423
  • 11
  • 100
  • 121

3 Answers3

0

You have to resolve a merge conflict, you have to decide which one you want to keep. Once you choose you can change the file, add and commit it.

Looks like one of you wanted to add :

  @Inject
    TripPlannerOmnitureReporter reporter;

    private TripPlannerCardAdapter adapter;

An the other one something else. If it was you then you can choose alone, if not then you should ask your teammate.

Claude
  • 11
  • 5
0

Well, The lines above, are dividing the two different versions of your code. One of them is your changes, and the other one is the master (I assume) or other branch changes. When you merged, git couldn't resolve this automatically so now you have to decide and clean it up manually. You for sure want to keep this line "private TripPlannerAdapter adapter;" because it is in both commits.
And this line @Inject TripPlannerOmnitureReporter reporter; you might as well keep it. If you wrote this line, I'm guessing you want it. If you didn't, then someone else did, and you probably want to have it as well. Try to build, and run and check if everything works!

@Inject
TripPlannerOmnitureReporter reporter;

private TripPlannerCardAdapter adapter;
Tomas
  • 11
  • 2
0

Usually git make marks with <<<, =======, and >>>>>>> to point out where your code has a conflict. A conflict is a part of the code where more than one programmer changed at the same time and the version control could not figure out which it should keep.

You just have to decide which part to keep and the one to delete.

It seems to me, that you should delete between ====== and >>>>>>>. Including every line with the marks (<<<,======,>>>>>>>).

Basically, keep the code:

@Inject
TripPlannerOmnitureReporter reporter;

private TripPlannerCardAdapter adapter;
morishi
  • 43
  • 7