TFS: How do I cleanup the messed up server? - visual-studio

I'm using TFS to connect to codeplex.com. The source version of the project is messed up, and I want to replace it. Found a way to delete the project, but it won't let me delete it. How can I say delete all of the subprojects without deleting the representative folders on the hard drive?
Note: this is codeplex so I have limited issues.
Thanks.

If I understand the question correctly, you want to delete the folders on the server but not delete anything locally. You then want to re-add your code using what you have locally. Is that correct?
Possibly the easiest way to do this is to copy the code you have locally into a separate back-up folder on your desktop. Then perform a delete using Source Control Explorer in Visual Studio. Check-in the delete. Finally drag/drop the contents of your local back-up into Source Control Explorer (you need Visual Studio 2008 SP1 for drag/drop to work) so that it adds the appropriate files for you to.
Check the pending adds that you have to make sure all the files you want are included and no files you do not want (i.e. make sure any compilation outputs are not included and that the folder format in source control explorer is how you want it to be)
Once you are happy, check-in your adds.
Let me know if I didn't understand the question correctly.

I would recommend against doing that. TFS can get confused by deleting and re-adding. At least, that is the case if you have any branching & merging to do. If not... well, go ahead.

Related

TFS Connectivity and Ignore Issues

I am having some trouble with TFS:
I have ignore rules for certain files. For example:
\Build\Scripts*.sum
It does not seem to recognize this. But, if I exclude these files in the Visual Studio UI, it remembers that I excluded them for some time.Then I lose connectivity and I have to re-exclude them. Why doesnt the tfignore file seem to be working. This leads to:
I routinely lose the ability to connect to TFS. Ill be moving along happily working. then Ill go and check in some code and I will get the error that I do not have access to TFS. If I restart Visual Studio, I can then successfully connect and check in code. Things will be fine for a few hours, and then it will happen again. Why do I lose the ability to connect? And why does restarting fix it?
First make sure you were using the correctly .tfignore file.** This file does not have any suffix. One way to create it, suggest you to rename a new.txt file with "tfignore." It will auto change to right .tfignore file.
You can also use the auto automatically generated .tfignore file, follow below steps in my answer here.
More detail info about the .tfignore file please refer this tutorial.
Note: This .tfignore file will not affect with those files already in source control. You need to remove them from source control first. Also make sure your .tfignore files have checked in source control.
That sounds wired. get the error that I do not have access to TFS what's the detail error here? If restart Visual Studio, can then successfully connect and check in code. It shouldn't be a permission related issue.
One possibility is network related, double check and confirm if there is any instability of your network environment. If you are behind VPN, try to connect without VPN.
Since Restart Visual Studio fixed the issue, it also may related to cache. Try to clear TFS and VS cache, which may do the trick.
The issue was that TFS thought these items had been "added" although that was not entirely clear from Visual Studio UI. I had to go to the Source Control Explorer and look at the folder where these files were. They were listed as 'add' which is how I figured this out. I never explicitly added these files. I had to right click on these items and remove them.

TFS Not Deleting Artifacts From Source Control

Oddly, source control seems to be holding onto files & projects even though I have deleted the artifacts from the Visual Studio Solution (itself). The GetLatest brings down the correct files (even when I delete the underlying artifacts from my workspace by hand). I have never seen this behavior in other servers...in fact...not even my PERSONAL Visual Studio Online behaves this way.
Now...to delete files...I have to delete things twice: once in the solution & once in TFS.
MY QUESTIONS:
Why is TFS holding onto the files in Source Control?
Is this a setting?
How do we fix this?
This is an internal TFS server & I am not the administrator. They are "new" so I am sure I will have to explain the issue at-length.
FOR EXAMPLE:
It's a normal phenomenon. Team Foundation Server uses your workspace to keep track of what files you have downloaded and what version you have of them. The reason it does this is so that it can maintain your files without a costly sync step. With TFS, when you say "Get latest", you only get the latest version of files that have changed since you last got them.
If you delete a file on the server and check that delete in, then when somebody does a "Get Latest", the file is deleted on their local system as well. It's for keeping the local file system in sync with the servers.
If you want to just delete the folder and files locally, there are two way to achieve it, more detail info please refer the answers in below question:Delete Local Folder in TFS

TFS re-add Visual Studio 2010 project

I have a project that is source controlled using TFS. I was doing some coding on my laptop when, unfortunately, my computer crashed and I ended up having to re-install Windows. I was afraid that all my code would be lost, but thankfully I was able to restore the code files.
My problem is that now I need to commit the changes to TFS. Currently the projects do not have any source bindings. I can't overwrite the current code base because there is work that has been done since my crash by other devs.
How can I add the changes I've made to TFS?
The way i've done something like this is kinda hackish, but what i usually do is get latest from TFS onto my laptop, and checkout all of the code from the project in question. Then i take the changed code and copy it over that folder, check it in. TFS should be smart enough to only really affect the actual code items that have been changed. You can see in the history the actual files that got changed to be sure.
If you know the exact files that you need to update, then that will make things much easier, because you can do the above steps, but then just check out the particular files you know of. You can do a compare between them and your new code to make sure that you don't overwrite anything your other programmers have done. Again, hackish, but i don't know of any streamlined way to do this.
You might want to make sure that you download the TFS visual studio extension, since that will give you rollback capability.

Forgot to shelve my code in TFS. What are my options now?

I made some code changes (in VS 2010), and did not check in or shelve my latest changes. Unfortunately, my laptop had a heating problem and I can't use it for another week (it's going for service). I have the hard drive with me though, so I can probably access the code from another machine. But how do I do it without messing up the state in TFS? If I copy-paste all my code from the hard drive into the other machine, VS will check out all my files right? Is there a better way to do this?
Thanks!
I would check the files out that you think are changed (you can use a tool like WinMerge to see which files have changed), copy the updated files from the old drive, and shelve or check them back in.
If the files are in a solution and you have the complete structure on your disk try if the "Go online" feature is available if you open the solution.
"File => SourceControl => Go online" or go to another machine and map your workspace to your disk with the changed source code.
(I would create a temporary private workspace for that situation and delete it after successfull merging/checkin).
I suppose if you open the solution and it has a valid source control binding, you get a message that your solution is right to go online.
If this dialog appears select "yes", all changes are correctly detected and you can merge/checkin in the normal way.
On the new machine get the latest code from branch, which comes with previously checked-out TFS version by you, then copy/paste the files from harddisk to replace tfs verison.

Renaming files: Visual Studio vs Version control

The problem with renaming files is that if you want to take advantage of Visual Studio refactoring, you really need to do it from inside Visual Studio.
But most (not all*) version control system also want to be the ones doing the renaming.
One solution is to use integrated source control, but this is not always available, and in some cases is pretty clunky.
I'd personally be more comfortable using source control separately, outside of Visual Studio, but I'm not sure how to manage this question of file renames.
So, for those of you that use Visual Studio, which source control do you use? Do you use a VS integration (which one?) and otherwise, how do you resolve this renaming problem?
(* git is smart enough to work it out for itself)
I use SVN (TortiseSVN as the client) and use the Repair Move command from the commit dialog heavily. This allows me to rename the files within VS and resolve the rename when I'm ready to commit to keep version history.
As far as using the VS integration, like you, I find all VS integration clunky and do not use it.
mercurial usually prefers to do the renaming via hg rename however it can also detect renames from an outside source by using hg addremove -s 100 (or less than 100 if you want to match a rename with alterations) so clearly you can let VS do the rename and get mercurial to catchup with addremove.
We use SVN (TortoiseSVN to be exact), and i am always bothered with the renaming problem. The simplest solution i've found is to remove the files from the project, rename them via TSVN and add them back to the project. You have to manually update includes for renamed header files, but this is relatively easy using find&replace.
We use Team Foundation Server, and it works with no problems. I've also found that moving to using a fully integrated client has improved my workflow, as I don't need to flip between applications just to do trivial tasks.
We develop "Plastic SCM" and the Visual Studio Package supports move operations. But I see your point, I'm getting more and more comfortable with the idea of not having plugins/packages and then have the version control working behind the scenes and simply detecting what happened without having to be "plugged in" into the IDE. In fact we're working on it for next release...
Besides the above advice, for Visual Studio 2008 I found that after making all global changes to any file being renamed from within VS, including right clicking the file and renaming it, as well as a global search and replace for all strings, replacing the old file name with the new file name, you must, if the file is the initial startup file, right click and select it as "set as default page". Otherwise you'll may well get the "The resource cannot be found." error on runtime.

Resources