mrb398
mrb398

Reputation: 1317

Git merge conflict, but there is no visible difference

I often get conflicts when merging branches that look like this:

<<<<<<< HEAD
    private readonly IAdminService _adminService;

=======
    private readonly IAdminService _adminService;

>>>>>>> refs/remotes/origin/master

There is no visible difference. What would cause github to view this as a conflict?

Upvotes: 3

Views: 4979

Answers (1)

gzh
gzh

Reputation: 3616

Usually this is invoked by white spaces character, such as tab, space. you can set you editor to show these characters.Also git diff provides options to ignore those character.

--ignore-space-at-eol

Ignore changes in whitespace at EOL.

-b

--ignore-space-change

Ignore changes in amount of whitespace. This ignores whitespace at line end, and considers all other sequences of one or more whitespace characters to be equivalent.

-w

--ignore-all-space

Ignore whitespace when comparing lines. This ignores differences even > if one line has whitespace where the other line has none.

Upvotes: 4

Related Questions