Skip to content

git cherry-pick did not reset the worktree back with hard option #1782

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
chucklu opened this issue Aug 7, 2018 · 2 comments
Closed

git cherry-pick did not reset the worktree back with hard option #1782

chucklu opened this issue Aug 7, 2018 · 2 comments

Comments

@chucklu
Copy link

chucklu commented Aug 7, 2018

Setup

  • Which version of Git for Windows are you using? Is it 32-bit or 64-bit?
$ git --version --build-options

 git version 2.18.0.windows.1
cpu: x86_64
built from commit: cd1a74fc9dc8a07626c216940db9a51f25206e03
sizeof-long: 4
  • Which version of Windows are you running? Vista, 7, 8, 10? Is it 32-bit or 64-bit?
$ cmd.exe /c ver

Microsoft Windows [Version 10.0.16299.547]
  • What options did you set as part of the installation? Or did you choose the
    defaults?
# One of the following:
> type "C:\Program Files\Git\etc\install-options.txt"
> type "C:\Program Files (x86)\Git\etc\install-options.txt"
> type "%USERPROFILE%\AppData\Local\Programs\Git\etc\install-options.txt"
$ cat /etc/install-options.txt

Editor Option: Notepad++
Path Option: Cmd
SSH Option: OpenSSH
CURL Option: WinSSL
CRLF Option: CRLFAlways
Bash Terminal Option: MinTTY
Performance Tweaks FSCache: Enabled
Use Credential Manager: Enabled
Enable Symlinks: Disabled

Details

  • Which terminal/shell are you running Git from? e.g Bash/CMD/PowerShell/other

Bash

Try to abort the cherry-pick when the cherry-pick failed
git cherry-pick --abort
  • What did you expect to occur after running these commands?

abort the cherry-pick ,and the worktree should be clean

  • What actually happened instead?

It seems the cherry-pick was aborted, but the work tree was not reset back.
when I use "git status", it told me the files was modified( the files listed come from the commit which should be cherry-pick)

I think the cherry-pick --abort should reset back with --hard option as the git rebase --abort.

@dscho
Copy link
Member

dscho commented Aug 7, 2018

Please come up with a truly verifiable Minimal, Complete and Verifiable example. What you wrote in the report does not verify here:

$ git cherry-pick --abort
error: no cherry-pick or revert in progress
fatal: cherry-pick failed

@chucklu
Copy link
Author

chucklu commented Aug 8, 2018

can not reproduce, the cherry-pick failed situation only happened in #1780

@chucklu chucklu closed this as completed Aug 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants
@dscho @chucklu and others