Error 1, git apply, patch failed, trailing whitespace

XMLWordPrintable

    • Type: Suggestion
    • Resolution: Unresolved
    • None
    • Component/s: Git
    • None
    • Environment:
      OS X 10.10.3

      Trying to revert some changes via "Discard hunk". The change was: a blank line that contained some trailing spaces into just a blank line (with no spaces). This change came about from adding some debugging code and subsequently removing it (leaving a different blank line that was there before).

      It appears that git-apply is refusing to apply the patch (to revert the change) because it would only add whitespace.

      There's an option to git-apply to ignore this

      --ignore-whitespace

      or to deal with it

      --whitespace=<action>

      but SourceTree doesn't use those, or even expose them to me as a user to tell SourceTree that I want that option used.

      The only work-around seems to be to go into the IDE and changes the lines myself, which defeats the purpose of using SourceTree in the first place...

        1. Corrupt CSS file cache.png
          37 kB
          Patrick Weisensee
        2. pasted_image_at_2015_05_05_10_33_am.png
          120 kB
          Randall Meadows

            Assignee:
            Unassigned
            Reporter:
            Randall Meadows
            Votes:
            4 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: