0

I have checked out a remote branch and set it to track that remote branch with

"git branch localTrackingBranch origin/remoteBranchLocation"

I don't understand what's going on at this point. When I open the particular file of interest in my editor (vs code) there are incoming changes.

I do a git diff against the remote branch and apparently there are no differences.

Why are there incoming changes? Shouldn't that file look identical to the one in the remote branch? When I accept incoming changes and run git diff now there are differences. I am stumped.

I removed the file locally and did a git checkout on the file and the incoming changes are there still. Can anybody explain this and how to proceed/troubleshoot the problem?

My guess is that there is a merge in progress on this branch. So when I accept or decline incoming changes I see differences. I have tried this solution and apparently there is no merge in progress.

jc2700
  • 1
  • 1

1 Answers1

0

Someone didn't resolve a merge conflict and committed the merge conflict markers. They look like this:

Here are lines that are either unchanged from the common
ancestor, or cleanly resolved because only one side changed.
<<<<<<< yours:sample.txt
Conflict resolution is hard;
let's go shopping.
=======
Git makes conflict resolution easy.
>>>>>>> theirs:sample.txt
And here is another line that is cleanly resolved or unmodified.

Open the file in a more basic editor like notepad or vim to confirm.

krisz
  • 2,686
  • 2
  • 11
  • 18
  • Ahhhhhhhhh. So my editor interprets those characters and gives me actions to do something with those changes. Wow. I was stumped but that makes sense thank you. – jc2700 Mar 29 '20 at 23:07