Search code examples
git-cherry-pick

Why git cherry-pick leaves uncommitted changes exits with non-zero


Very often, my git appears like this:

 A <- B <- C <- D <- E <- HEAD

It happens that I need to create a new branch based on B and only the changes in D. Here are the commands I do:

git checkout B -q -f -b release
git cherry-pick D

The cherry pick commands exits with code 53 and leaves all the changes in D uncommitted in branch release.

More info: this is under Windows. The commands above are part of my release process which I run under PowerShell. When I do the same procedure in Git Bash, cherry pick works just fine. Is this (yet another) EOL issue? I tried adding -Xignore-all-space but error remains.

Context: as part of my release process, I pick a cut-off commit (e.g. B), modify version files to include build time, release author, etc. Just before I can commit my versioning changes, someone else introduces commit C. When I commit my versioning changes, it becomes D. My release process above is to ensure that binaries are compiled with A <- B <- D. How can I make that happen smoothly?


Solution

  • Problem was my PATH var. I had it set like:

    set PATH=%PATH%;"C:\Program Files (x86)\Git\mingw32\bin"
    

    I changed to:

    set PATH=%PATH%;C:\Program Files (x86)\Git\mingw32\bin
    

    And problem was solved.