git cherry-pick succeeds but shows worktree as dirty due to eol mismatch
I am trying to cherry-pick a change from another branch under Windows. The change creates a subdirectory and some files. While the command itself completes successfully,
git status reports all new files as changed.
git diff indicates a change in every line, but
git diff -w comes out empty, indicating an EOL issue. Here are more details:
$ git reset --hard 6e9f9af HEAD is now at 6e9f9af Hashing helper $ git status On branch newmaster nothing to commit, working directory clean $ git cherry-pick -m 1 5bd71b0 [newmaster d36aba2] <comment> Date: Sun Mar 27 19:21:35 2016 -0700 37 files changed, 2552 insertions(+) create mode 100644 src/phserver/winservice/Config.cpp . . . $ git status On branch newmaster Changes not staged for commit: (use "git add <file>..." to update what will be committed) (use "git checkout -- <file>..." to discard changes in working directory) modified: winservice/Config.cpp . . .
What did not help:
- when using git for windows, git bash could not work?
- Using msysGit from MinGW and vice versa
- git, msysgit, accents, utf-8, the definitive answers
- Git on Windows: How do you set up a mergetool?
- Which $VARIABLES can be passed to an external tool from git-gui?
- msysGit: Why does git log output blank lines?
- Setting repo’s
inputbefore the cherry-pick. This is interesting, as the files are new and not in the index before the command. Looks like I speak less Git than I thought…
- Attempting both Git for Windows 2.6.2 and Cygwin git 2.5.3.
git cherry-pick -Xignore-all-space
Modifying the cherry-pick commit. This worked to a degree:
$ git cherry-pick -m 1 5bd71b0 -Xignore-all-space -n $ git add -u . $ git commit
While that left the worktree clean, next cherry-picked patch failed horrifically due to eol mismatches–looks like this does not solve the issue in general, and only applicable when all files in the source commit are new.
I would appreciate suggestions, and, better yet, an explanation as to what is really going on.