Home > OS >  what happens to changes if I abort a cherry pick?
what happens to changes if I abort a cherry pick?

Time:09-25

I am using azure devops and I have made changes, but also added a commit message. The only option is to abort the cherry-pick. It will not let me commit even though I have a commit message and changes have been made. What happens to my current changes if I abort it?

CodePudding user response:

(Note: I'm going to assume you're using the command line since the only way I know of to cherry-pick something in Azure DevOps is in the context of a completed PR that you wish to bring to another branch.)

In Git, when you run a command that can do a merge (e.g. merge, rebase, revert, cherry-pick, etc.), it's possible there will be a conflict. If there is a conflict that needs manual intervention, you will have the option to --continue or --abort.

If you choose --abort, you will go back to the state you were in before you ran the command.

It's not clear when you made the "changes" that you are asking about. If they were committed before you ran the cherry-pick command, they will be retained after an abort. But if you made some changes while in the middle of conflict resolution, those changes will not be retained after an abort.

My suggestion to you would be to make a copy of the file(s) containing the changes you are concerned about potentially losing, and store that copy outside of your Git repo. Then go ahead and do the abort, if that's what makes the most sense in your scenario.

  • Related