DEV Community

Cover image for How to abort the whole git stash process if a merge conflict has occurred in Git?
MELVIN GEORGE
MELVIN GEORGE

Posted on • Edited on • Originally published at melvingeorge.me

How to abort the whole git stash process if a merge conflict has occurred in Git?

Originally posted here!

When popping out commits using the git stash pop command, you will have some merge conflicts sometimes, you can move to resolve those conflicts or abort the whole process.

To abort the whole process when a merge conflict has occurred during the git stash pop process is to use the,

# Stop Git stash on merge conflicts
git reset --merge
Enter fullscreen mode Exit fullscreen mode

command.

This has worked for me. I hope this works for you too! Cheers 😃.

Feel free to share if you found this useful 😃.


Top comments (3)

Collapse
 
seanmclem profile image
Seanmclem • Edited

error: unknown option reset

Collapse
 
aniitasmith profile image
Ana Cristina Smith • Edited

Heads-up! this will delete any & all untracked files in the repo (similar to --hard). Be extra careful when using this command if you have any untracked files

Collapse
 
harikn77 profile image
Hari Krishnan U M

no, it will only discard changes in tracked files