Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git stash equivalents in other revision control systems?

Does hg, svn or others have an option like git stash?

like image 797
Juanjo Conti Avatar asked Jul 17 '10 19:07

Juanjo Conti


People also ask

Can you git stash apply multiple times?

You can reapply stashed changes with the commands git stash apply and git stash pop . Both commands reapply the changes stashed in the latest stash (that is, stash@{0} ). A stash reapplies the changes while pop removes the changes from the stash and reapplies them to the working copy.

What is stash in git?

git stash temporarily shelves (or stashes) changes you've made to your working copy so you can work on something else, and then come back and re-apply them later on.

Where are git stashes stored?

All are stored in . git/refs/stash . git stash saves stashes indefinitely, and all of them are listed by git stash list . Please note that dropping or clearing the stash will remove it from the stash list, but you might still have unpruned nodes with the right data lying around.

Is git stash branch specific?

Nope the you get a stack (last-in-first-out) of stashes. You push a stash to your stash-stack, then another then you pop out the 2nd then you pop out the first, etc.


1 Answers

The general name for that feature is:

Shelving: the ability to actually upload intermediate revisions to the server without really checking them in.
In a CVCS (Centralized VCS), you actually need to upload those intermediate data to a central server.
But in a DVCS (Distributed VCS), you just need to store them in a the local repository.

There is:

  • the shelve extension for Mercurial
  • temporary branches for SVN, or patch files
  • p4tar (again patch based) for Perforce, even though the Perforce 2009.2 has now shelve and unshelve features.
  • saved checked-out data in Plastic SCM (for shelving data)

You can find all the other SCM shelving commands in this SCM comparison table on Wikipedia.

  • Accurev: keep / co (this is disputed in this question)
  • Bazaar: shelve / unshelve
  • Darcs: revert / unrevert
like image 82
VonC Avatar answered Sep 28 '22 04:09

VonC