Git will show conflicts if there are many spaces in the same file.
It can spend too much time to fix these conflicts if the spaces are too many.
Use git help merge to refer to the manual page.

ignore-space-change, ignore-all-space, ignore-space-at-eol, ignore-cr-at-eol
    Treats lines with the indicated type of whitespace change as unchanged for the sake of a three-way merge. Whitespace changes mixed with other changes to a line are not ignored. See
    also git-diff(1) -b, -w, --ignore-space-at-eol, and --ignore-cr-at-eol.

    •   If their version only introduces whitespace changes to a line, our version is used;

    •   If our version introduces whitespace changes but their version includes a substantial change, their version is used;

    •   Otherwise, the merge proceeds in the usual way.

Example:

I got the following scene when git pull at master branch.

Because git pull is shorthand for git fetch followed by git merge FETCH_HEAD, we can use git fetch firstly and then git merge FETCH_HEAD -X ignore-all-space.

Categories: Tool

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments

Content Summary
: Input your strings, the tool can get a brief summary of the content for you.

X
0
Would love your thoughts, please comment.x
()
x