Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Equivalent of git stash in CVS?

Tags:

git-stash

cvs

I need to test some old version of our source code, however I have some local changes. So I would like to "stash" these changes, checkout the old version, do some tests, then go back to the current version, and restore my changes. Is it possible to do this kind of workflow in CVS? Basically, what I need is the equivalent of git stash/restore.

like image 377
laurent Avatar asked Nov 27 '12 03:11

laurent


People also ask

What is git stash?

The git stash command takes your uncommitted changes (both staged and unstaged), saves them away for later use, and then reverts them from your working copy. For example: $ git status On branch main Changes to be committed: new file: style. css Changes not staged for commit: modified: index.

How can I see my git stash list?

Git Stash List. The Git stash list command will pull up a list of your repository's stashes. Git will display all of your stashes and a corresponding stash index. Now, if you wish to view the contents of a specific stash, you can run the Git stash show command followed by stash@ and the desired index.

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.


1 Answers

CVS is primitive in comparison to modern source control systems. There is no direct equivilent to stash.

The closest you'll get is using cvs diff -u to create a unified diff of your changes, then revert the changes, do whatever you need to do, revert / update again, then apply the patch to get your changes back.

Alternatively, you could just create another checkout in another directory and work there independently.

like image 83
Charles Avatar answered Sep 22 '22 10:09

Charles