Alex Rivera | Logout

what's the Git equivalent of TFS commands shelve/unshelve? cherry-pick?

Asked 2010-06-18T13:27:47.187
84

I found that the shelve/unshelve commands in TFS are very handy and very simple to use. What's the equivalent in Git ?

here's the scenario in TFS :

  • I made changes in the trunk
  • I shelve : the change set is saved on the server (with a label) and I get the source back before the changes
  • I work in the trunk
  • Someone can unshelve : get the change set in his workspace

I know that there's a command call cherry-pick but i"m not sure of the workflow and if it fits the need.

Edit
Report

1 Answer

5

git stash is a bit similar, except it is limited to your working tree.

In a DVCS, to achieve that kind of workflow, you need to:

  • commit your current changes in a new branch
  • checkout the original branch where you can go on, with none of the changes you had introduced (but committed in the new branch)
  • push that new branch to a bare repo
  • allow another developer to pull that new branch and merge it to his current branch.

Another way would be to let the other developer fetch your branch (where you have committed that special set of changes), and cherry-pick it, but that is not recommended, for cherry-picked commits are hard to track.

answered 2010-06-18T13:33:44.420

Your Answer