Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7662865
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T13:54:36+00:00 2026-05-31T13:54:36+00:00

I’ve got a problem, where a large commit which changes about a thousand lines

  • 0

I’ve got a problem, where a large commit which changes about a thousand lines of code, removing whitespace from the end of lines and removing spaces before tabs.

There are also about 50 pull requests for this project, in which all will get conflicts, when my commit is merged. Is there any way that git can be set up so that when merging future commits, it ignores conflicts where one of them is just a whitespace change?

Modifying git itself or using a third party tool isn’t possible, but using a hook is fine.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T13:54:37+00:00Added an answer on May 31, 2026 at 1:54 pm
     git merge -Xignore-all-space
    

    Or (more precise)

     git merge -Xignore-space-change
    

    should be enough to ignore all space related conflicts during the merge.

    See git diff:

    --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.

    --ignore-all-space
    

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

    ks1322 adds in the comments a good advice:

    It is worth to merge with --no-commit and review the merge before actual commit.


    The OP Callum Macrae reports that, in that case, the merge proceed uninterrupted, and the trailing spaces contained in the pull request patches are applied to the local files.
    However, the OP uses a pre-commit hook which takes care of said trailing spaces.
    (I suppose a bit similar to this one, also referenced here).


    The OP’s pre-commit hook is referenced here:

    In addition to removing trailing whitespace, it removes one to three spaces before tabs (I have tab width set to 4), and adds EOLs.
    I’ve had reports that the code that adds the EOL deletes the file in windows, but haven’t been able to replicate it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a text area in my form which accepts all possible characters from
I am currently running into a problem where an element is coming back from
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
I've got a string that has curly quotes in it. I'd like to replace
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.