Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS & TFS: Check-in as new branch

I was coding as usual, but what was supposed to be a minor change ended up as a big new implementation... New controllers and views and some domain refactoring... because of the time constraint I don't feel comfortable enough to just check-in the code to the trunk... I would like to create a new branch with this code... and test it properly...

how can I do this? How can I create a new branch and submit code to it on the fly?
So far all I could find is "open a new branch, copy your code in X, fire up the solution, paste the code"...

like image 679
Leonardo Avatar asked Feb 26 '15 12:02

Leonardo


1 Answers

If you are using a Git repository in your team project then you can just create a new branch in the UI and 'check out'. Any uncommitted changes will be automatically ported to the new branch. You can then commit them there.

If your Team Project is configured for TFVC then you will have to create a new branch in Server Explorer. Once you have done a 'get' of that branch you can copy your changes over. As your new branch should be identical to what trunk looked like when you started if you just drop your new files over the top you can then check in. You will need to handel deletes yourself.

Another way with TFVC is to Shelve your changes and unshelve them on the other branch. This is not specifically supported in the main product, but the TFS Power Tools provide this added capability.

like image 77
MrHinsh - Martin Hinshelwood Avatar answered Oct 05 '22 20:10

MrHinsh - Martin Hinshelwood