Sunday, July 2, 2017

Shelveset in TFS , git and subverson

First. What is shelveset.
In TFS ( Team Foundation Server from Microsoft) you can store yours changes on server for later use. You can specify the name, but also your developer name will be stored with that change. You can also specify if changes will be preserved on your pc (aka workspace/repository) or not.
Created shelveset you can  "unshelve" and use it whenever you need on the original pc, but, you can use that shelveset on another computer if needed , like when you are in another office, on a business trip, or simply when your pc is broken somehow, and also another colleague, whenever is located, can unshelve your shelveset.

So it is  quite useful.

But what about git ? Is there something similar ?

Yes, and no :-)
Git have a stash. You can stash , there is command for that, your changes, which then will be stored in "stash part" of git repository. But usually you are using local repository, so when you should use another computer you are lost. Of course you can commit and push your changes to remote/origin repository, so if you have a branch on remote repository , you will got something similar as TFS shelveset. There is also possibility to migrate stash from one repository to another, but I never tried that successfully ...
But there is advantage in comparison to TFS. TFS, it is a shame, is storing shelveset with branch information. So you can unshelve shelveset just into the same branch ! Crazy. Of course there is solution, but it is command line based ... Git stash can be "unstashed" into anyone branch.

But what about subversion (svn) ?
Yes there is something. A patch. You can create patch of your changes. It is one file which you can store whenever you like. If you will crate a folder under your subversion repository, you can also upload/commit your patch file into subversion  repository and then you or anybody else can use it .

Also there are other versioning systems like Mercurial but I never used them ;-)
Maybe in the future.

No comments:

Post a Comment