What is the difference between IntelliJ's Shelve and Git stash?

Daniel Compton picture Daniel Compton · Oct 7, 2015 · Viewed 32k times · Source

IntelliJ supports git stashes as well as it's own built in shelve command. These seem to be almost identical in purpose and utility. What is the difference between them?

Answer

Daniel Compton picture Daniel Compton · Oct 7, 2015

From the IntelliJ documentation:

In the Git integration, in addition to shelving and unshelving, "stashing" and "unstashing" are supported respectively. These features have much in common, the only difference is in the way patches are generated and applied.

  • Patches with stashed changes are generated by Git itself. To apply them later, you do not need IntelliJ IDEA.
  • Patches with shelved changes are generated by IntelliJ IDEA. Normally, they are also applied through the IDE. Applying shelved changes outside IntelliJ IDEA is also possible but requires additional steps.