Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Branch from local workspace

I was developing team project and suddenly realised that i've made so many changes, that i need create branch.

I've never used branching in TFS and when i saw "Branch\ "From Workspace version" i thought that's, what i need. But this option doesn't act as i supposed.

How can i create new branch, from my "LOCAL COPY of Project" and include all local changes"? The option that I mentioned above creates something like branch from...i don't know exacly from what, but i know for sure, that not from my local version with all changes. As i noticed, generated branch doesn't have files and project which i added.

like image 995
Simon Avatar asked Sep 16 '10 15:09

Simon


2 Answers

What I would do is:

  • Shelve your work
  • Branch from the appropriate source folder
  • Use TFS Power Tools to unshelve to a different location
  • Check in.

That way, you get a nice clean branch, and you get a record of the changes you have made.

like image 143
Robaticus Avatar answered Sep 29 '22 06:09

Robaticus


  1. Download and install TFS Power Tools
  2. Shelve your work and remember the name
  3. Create your destination branch from the trunk you've been working in
  4. Map your new branch and get a local copy of the code
  5. Open Windows PowerShell and change to the directory of the original source code
  6. Run the following command replacing the Shelve set name and directory structure with your own:

    tfpt unshelve /migrate "MyShelveset" "/source:$/project/trunk" "/target:$/project/branch" 
    

(quotes around shelveset name are required if it contains spaces)

This should help you avoid some of the problems I ran into when I was trying to follow the original instructions.

like image 34
Kevin T Avatar answered Sep 29 '22 06:09

Kevin T