I'm a self-confessed tfs newbie using VS2010 with team explorer. My application uses version control. I wish to rename my current project ProjectA to something else like ProjectA_01. Then after I've made my architecture changes on a new VS2010 solution I wish to check in the new project as ProjectA. A list of steps would be helpful.
Thanks
I'm pretty sure you can't rename a project in TFS. You could create a new project named ProjectA_01 if you wish, but from the sound of what you are trying to accomplish, I think what you want is to work with branches.
Essentially, you put all of your code in a folder under your project. So, on your hard drive it would look something like this:
C:\tfs folder\ProjectA\Main
All of your source code goes in the Main folder. Then in the Source Control Explorer window in Visual Studio, right click on the Main folder and select Branching and Merging -> Convert to Branch. This is your Main branch (or trunk) and you could use it for code that is ready for beta testing or a product release.
Once you created the main branch, you can right click on the branch again and select Branching and Merging -> Branch. At that point, you can name it ProjectA_01 or whatever you wish. Typically this would be your development branch where you do the bulk of your development.
After you make all of your changes in the ProjectA_01 branch and check in all of your code, you can right click on the ProjectA_01 branch once more and select Branching and Merging -> Merge, which will move all of your changes back to the Main branch (which would signify it is ready for user testing or release).
"Hawkke" is correct in that you cannot rename a team project. If you want this feature, you can vote for it here: http://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/2037605-rename-project-in-tfs. It is currently the #1 voted feature for TFS at this time.
I'm actually having a hard time understanding if you are talking about renaming a TFS team project or if you are talking about renaming a Visual Studio project. Unfortunately they are named the same.
However, usually team projects are very large and you would have lots of different product families, products, and ultimately Visual Studio solutions & projects in the same team project. You can create subfolders, including maybe even an "Archive" folder in this case, inside of the team project to organize your source code better.
Let us know if we aren't understanding your question though.
Related
Background: We use a feature branching strategy to isolate change. Here's a quick diagram of what I mean. Nodes are branches, edges are parent/child relationships in TFS:
Most of the time we create feature branches on a per issue basis, so there are a lot of feature branches.
Also, for my purposes, I only care about migrating source control and changeset history. We don't use TFS work items, test cases, or test results.
Attempt 1: When I first ran the migration tool, it ran for about an entire day before filling up my hard drive and failing.
Attempt 2: Thinking that the 150ish feature branches were the culprit for the slowness/storage needs, I wanted a way to migrate only the "dev" branch of my "ecomm" team project collection in the diagram above. I did not see any way in the opshub tool to migrate a single branch.
I accomplished this by creating a new team project collection "ecomm-migration", then branched $/ecomm/dev to $/ecomm-migration/dev. Then I migrated the ecomm-migration team project collection (which only contains a single branch).
Everything seemed to work: I could see all my source files on Visual Studio Online. However, when I browsed the history of the ecomm-migration project that was migrated to Visual Studio Online, the history was lost: everything appeared to be committed as a single changeset, and annotating files reflected this as well.
Why didn't the changeset history get migrated?
Am I doing it wrong?
Does my approach of creating a separate team project collection to reduce the size of the team project collection being migrated interfere with the tools ability to migrate changeset history?
Are there better tools/options for my scenario?
One thing I had previously considered was pruning dead feature branches with tf destroy, but it would be nice to avoid such drastic, irreversible, history destroying measures if possible.
I am using version 1.1.0.005 of the utility.
Can you please also share what is the version of the utility that you are using? You can find that from the About button on the utility left menu pane.
Addressing your concerns in points.
The disk space requirements of the utility is equivalent to the size of your project. A good reference point would be to get the latest version of the project to your hard drive through Visual Studio and see the size. So that SIZE + 20% would be a good approximation of space that the utility will need in your C: drive during the migration process.
While you did nothing wrong by branching your dev branch into a new project. The utility did nothing wrong either. When you migrated to VSO, you might have selected only the newly created project. Now in your VSO, the trunk of your data in the new project is not present. So, the utility converts Branch -> to -> Add. Which is the only sane way to migrate when source is not selected/available.
To get your desired result (of actual history) you will have to select all the projects where branch-merge was done (across projects) for migration. Which of course is nothing but what you did in Step 1.
Hence, we suggest you to migrate your original project, if you want to retain full history. We can work together to overcome the memory/space crunches that you are stuck in.
Im not an expert at git, but I have a iOS project that has code that I would like to reuse. I will be switching out images and a little data to make each application different. I know you can do this with the targets approach but I wanted to keep everything seperate and out of the original xcode project. So my question is, do I create a branch for each new project, and if so what is the correct terminology or command to grab bug updates from the original code base into my new branch from the main branch? The new branch will never commit back to the master branch also.
I strongly suggest you make different repository for each project, not different branch.
If you have one repository for several projects and for each project different branch, very soon you'll have a mess in your repo.
Also, if you fix a bug on part of code which you want to reuse, you'll need to merge the fix with all branches which use that code.
So, I think the better and much cleaner approach would be to create different repositories for each project, and code which you want to reuse you can add as a git submodule.
So, you'll have repository for your iPhone project then submodule for your shared library, Restkit, and so on...
You will want to review the git branching section of the online reference at GIT-SCM. At a high level you will want to look at merging the various branches. Xcode 5/5.0.1 helps you immensely by using the menu Source Control > Working Copy > Project Name > New, Switch, or Select Merge Into/From Options...
Context: I'm currently working as an intern at a company which has made the move to TFS 2010 from VSS. TFS has been in use here for a couple of months now, but in the early period after the move some 'mistakes' were made in setting up the projects. After while the need for a custom team project template was recognized. The template has been developed and is now being introduced into the organisation. (small web development company, many small projects)
Question:
We're trying to migrate old projects to the new template by setting up new pojects with the custom template. We'd like to move the sources of the old projects into projects making use of the new template. The history of the sources should be preserved for support reasons. It is undesireable for the old projects to appear in the Team Collections' Team Projects list, so we'd like to hide them if deletion is not an option. (to reduce the garbage in the list)
I have some solutions on my mind to get the job done, but I'm unsure if they'll work out. (even after spending some time researching the issue on the web)
1: Doing a branch from the old project into the new and then deleting the old project. I think it should keep the history of the the old project has been deleted. Some people over here are very vocal about this not being the case causing some strife. Before pushing this option I'd like to be sure this will work
2: Hijack the migration tool to migrate sources between projects (possibly via via a temporary Team Collection). I have read this could be an option, but the details of how to execute such a move are still unclear to me. It seems this has a lot of caveats attached to it and can be cumbersome to execute. (I'm no superman when it come to these matters, but so is noone else over here)
The Migration guide seems to suggest that this might be possible, but I can't determine if this scenario is supported, and how to recover if things go wrong.
Maybe it is possible to set up the new projects and hide the old projects from the team collections' team projects list without deleting them? (I wonder if there is some kind of inactive setting for team projects, I can't seem to find any such option after exploring the tfsconfig tool of the admin console)
An explanation of how to best apporach this problem and possible solutions would be much appreaciated.
Doing a branch from the old project
into the new and then deleting the old
project. I think it should keep the
history of the the old project has
been deleted.
I'm pretty sure if the old team project is deleted, the part of history that is associated with that team project will also be gone, see here for more details. You can confirm this by doing a quick test move if you want.
Maybe it is possible to set up the new
projects and hide the old projects
from the team collections' team
projects list without deleting them?
You can mostly achieve this by denying read access (GenericRead) to most of the users on the old team projects. Of course for the Project Collection Administrators who have this permission by default on all the team projects, the old team projects still appear in the list for them.
Good luck!
There is no firm relationship between a team project and a particular part of the source control tree. Let's say you have a team project named "Mistake". You have source at "$/Mistake". You can now create a new team project named "Got It Right", and specify to use the sources at "$/Mistake".
Use the source control explorer to move a solution between projects. Here is how the projects and solutions appear before moving a solution.
The move selection is found by either
right-clicking the solution, choosing Move from the drop-down menu
Selecting Move from the Source Control menu found under File in the drop down menu
In VS, it's simple. Everything the project needs is stored in the project folder and all VS settings are stored in one place. Eclipse, however, stores Eclipse settings with the project and keeps a .metadata at the workspace level which is needed to detect the projects in the workspace. Thus, I can't simply branch a project and then open it in Eclipse. I need to set up a workspace, branch it into that workspace, copy over all my workspace settings (settings import/export doesn't even work right in Eclipse) so I have the same Eclipse settings, then do some kind of import to get the project in the workspace. This is what I generally refer to as a pain in the freaking neck, and it causes me to not branch any Java projects and to keep them all in one folder. This is also a pain.
Is there any way I can get a setup where I can just branch a project and open it in Eclipse, while maintaining the same Eclipse settings?
UPDATE: The current state of the question is expressed by the comment to soru's post.
Pretty sure you want to:
Keep the same workspace for all projects (or maybe a few, at the level of say 'hobby' and 'work').
switch between different branches in the same project by using the features of your version control tool/plugin
if you want to work on multiple branches at the same time, just create two projects, and manage them both as above.
if you want to temporarily hide the inactive version, use the 'working set' feature.
The main limitation is that you might want to have projects with the same name, but you can't. So sometimes you have to make up a project name different from the underlying folder name.
In general, mapping between VS and Eclipse:
Installation <-> workspace
Solution <-> working set
Project <-> project or folder or VC system branch or working set node
Refs:
VS object model
using working sets in Eclipse
working with branches in subclipe
Well, I'm not a fan of keeping any IDE specific settings in the repo, but when I do I keep only .project, .classpath and .settings.
You can also keep you settings at the workspace level (Windows->Preferences),and not on the project level (Project->Properties).
Also why do you create a seperate workspace for branches? You can keep it in one workspace, no need to create another one.
You could also use "switch" in subversion (I don't know if that's what you are using, but other revision systems should have something similar) and go to the branch you have created.
(of course if you wan to work concurrently on more than one branch then it doesn't help)
I can't speak to the Eclispe problem, as i'm only a n00b user, but I can speak to the secondary question.
I've been working in systems for a number of years that ended up needing to have various branches of the same code done for a variety of reasons.
One of the best reasons for keeping specific settings in project-specific locations is that so the various compiler / sdk / etc. settings & files can be specific per-branch and not collide between branches.
This allows, for example, for the work to upgrade a code set to a newer sdk/compiler to be done without impacting the ability to work on the existing "main line" code set with the previous sdk/compiler should the need arise.
In my experience in the computer game industry as a core technology wog, this happens a LOT.
I'm sure the same situations occur outside the computer game industry, maybe just not at the same pace.
I have been using an open source Java project and had to make some custom changes for our site. I have downloaded the source code via Subversion, modified two files and built a custom JAR file. Now I need to store these custom changes into OUR Subversion source control system. What is the best way to do this?
Should I check the entire tagged version of the open source code into our system and then create a branch with our change in it? Or should I just check-in our custom files and rely on the open source tagged version to always be around? Or perhaps something else altogether?
Take a good look at Subversion vendor branches, which are meant for "maintain[ing] custom modifications to third-party data in your own version control system". This sounds like exactly what you want. You would create a vendor branch for the open source Java project in your main repo (from their last SVN revision before your modifications). Then, check in your modifications. In the future, you can merge in upstream changes.
The Subversion book is free and available online, with a section devoted to choosing a repository layout.
the Subversion community recommends
that you choose a repository location
for each project root—the “topmost”
directory that contains data related
to that project—and then create three
subdirectories beneath that root:
trunk, meaning the directory under
which the main project development
occurs; branches, which is a directory
in which to create various named
branches of the main development line;
and tags, which is a collection of
tree snapshots that are created, and
perhaps destroyed, but never changed.
I'm happy to elaborate if you are having trouble determining what exactly this means for your project.
First try to avoid this as long as you can, if it is possible try to get your changes into the open-source project (less work for your self in the future...)
But if that was not a option, I would follow Matthew Flaschen advice about vendor branches.