tfs check-in project wants to delete file - tfs

I am not sure how this happen I want to check-in the project sln but it wants to include a delete. If I filter pending changes it displays this file but I dont want to delete it I want to keep it and add the lock. When I try to undo I get a message the file must be deleted.
Is there anyway around this?

It seems that there are someone deleted files but affected and did a "tf delete" on this .aspx file.
For solve this, please try with follow steps:
First, rename this file(ListOfDrug.aspx) to something else (ie
NewListDrug.aspx)
Undo pending delete of packages.config
Checkout packages.config from TFS
Delete packages.config from fileSystem
Rename newpackages.config back to packages.config
I know this may painful, especially affects many different projects at the same time. But this seem be the useful way to solve this issue.

Related

TFS checkin error - could not find file

When checking in my project I get the error:
Could not find file 'C\blah blah blah'.
I have a feeling this might be a file from an old project I deleted.
I have tried deleting my TFS connection and workspaces.
This will happen when TFS has some changes staged that no longer exist on the file system. For instance, if you add some files in Visual Studio (which adds them to the changes list), delete them directly from the file system, then attempt to check in the changes, it will complain that it could not find the file(s).
To remove these changes from the list, you can open Source Control Explorer (View > Other Windows > Source Control Explorer) and either Delete the nonexistent files or right-click on the offending files and Undo Pending Changes.
You can also undo these specific changes from the Pending Changes panel in Team Explorer.
Create an empty file to replace the missing file and complete your check-in. After you have checked in the file correctly delete the file that is not needed.
Go to the project that has file 'blah blah blah', you should see the file has an error mark indicating it does not exist. Right click the file > Delete. That should take care of the problem.
I had a similar problem. I had forgotten I was tinkering with adding publish profiles for publish. TFS felt it needed to check that in, even though the output wasn't there. I simply right clicked on the App.Publish folder in Team Explorer inside of visual studio and chose to exclude. Checked everything back in with no problem.
I encountered the same error:
but my issue was a bit different. I was changing a couple of folder names and when committing I didn't add the new folders to the repo:
git add folderName
solved the issue for me.

Unable to resolve pending changes after renaming a folder

I renamed a folder correctly in Visual Studio (shows as a move) but after merging down to the parent branch, I've now got numerous conflicts that I'm unable to resolve.
They show up in the 'Resolve Conflicts' window with the Description, 'You have a conflicting pending change.' against each conflict.
If I try to resolve by taking the server or the local version, they disappear but reappear seconds later.
I've tried tf undo * /recursive from the parent folder but that reports 'no pending changes to undo' and I've tried delete the entire folder and 'Get Specific Version..' and forced over-write but nothing I do can get rid of these conflicts.
I ended up deleting the workspace and re-getting the latest code before trying the merge again, and everything worked fine. I'm guessing there was some sort of corruption in the workspace.
This worked for me:
1. Exit Visual Studio
2. Open a command window and navigate to the folder: "%localappdata%\Microsoft\Team Foundation\"
3. Navigate to the sub folders for every version and delete the sub folder "cache" and its contents
4. Restart Visual Studio and connect to TFS.
5. Undo/Get Latest Version.
Try undoing any dependent changes first, retrace your steps that you did in the merge. Don't try to undo all changes at once. It's likely there are dependent changes that need to be undone before you can undo the one in question.
e.g. If you have renamed/deleted files or a folder then undoing the rename may cause a clash with some other folder or files, so undo the merge of those dependent files/solders first, then try undoing the renamed/deleted ones.
I have found that if you try to do rename, edit and merge in one go it will get confused and when you go to undo it there will be conflicts unless you undo the conflicting changes first.

Manually update files

Scenario:
A solution is checked into TFS. Changes are made to an offline/disconnected/unbound copy of the solution, which becomes "the latest" version. I want to update the repo with this disconnected copy's files.
How do I get TFS to look at all the files and determine which ones have changed, so it can check only those in?
If this were SVN, I would just plop the files on top of the existing working copy, and it would just work.
Do you have another copy of the solution that is bound to TFS? If not, you'll need one. You have two options:
Take the solution "offline" by right-clicking on the solution node and click "Go Offline". You can then copy your changed solution on top of the bound solution. When you load the solution again, right-click the solution again and choose Go Online. This will scan the disk and determine what has changed.
You other options is to run "tf edit" recursively on a bound solution, copy your changed solution on top of the bound one and then run "tfpt uu". "uu" stands for undo unchanged and it will undo changes to the files that are not different.
I cant think of any elegant way off hand but your best option would be to know what files were changed or added offline and connect them to the TFS version while removing the old TFS files.
To do this simply right click all of the old files and either delete them or exclude them from the project then move the new files into their physical folders and replace them with the updated version. If files were added then add them in the correct folders. Finally make sure all files are view-able in the solution explorer by clicking "show all files". Finally, right click the files you changed and select include in project for each.
This way you will have replaced only the files that were changed and won't have to check in the entire solution to TFS making it very unclear what files were changed with your check-in.

If you use TFS version control, how do you remove a folder?

How does one remove a project from a solution in TFS?
We are using the TFS version control system.
We have a sln file that has lots of projects.
I have removed the project from the Solution Explorer.
But in the "Source Control Explorer" window, the folder containing the project's files are still there.
If I try to delete the folder I want to delete from the "Source Control Explorer" window, and I get an error that says it cannot be deleted. It says that one or more children have pending changes. Well, I have the folder checked out. What else do I have to do?
The files in the project are listed as being checked out.
You cannot pend changes on items and then delete their parent. This prevents data loss - for example, if you were to pend an edit on $/A/file.txt and then delete $/A, you would lose those uncommitted changes. Thus, you must explicitly undo the edit changes if you really want to delete the folder.
(If you only have deletes pended on the children, you are still allowed to delete the parent folder, as this would not result in data loss.)
Simply use "Undo Checkout" from the workspace that has the files checked out.
You can also use the command line to perform a delete.
tf delete [/lock:(none|checkin|checkout)] [/recursive] [/login:username,[password]] itemspec
http://msdn.microsoft.com/en-us/library/k45zb450.aspx
Also, note that the items are not officially deleted until you perform a Check-in of the delete.
" The results of this command are not visible in other workspaces until you perform a check-in operation. For more information, see Check In Pending Changes."

How do i remove files from the Pending Changes list in TFS when those files weren't in the source yet and have been deleted locally

Someone added a workspace incorrectly, so after I fixed it TFS thought I had added some files to the project (dll, pdb, and xmls). So I tried just deleting the files and refreshing the pending changes. I tried clicking undo, but the Output window says
No pending changes were found for
$/SourceCode/Apps/.../Lib.dll.
(I replaced part of the full path here).
So the undo won't do anything.
I tried "Refresh Status" under File-> Source Control after every step.
I tried re-adding these files and then doing the undo.
So for example I am stuck with
Name Change
UI.xml add, lock
Design.dll add, lock
and can't remove them.
Any suggestions are appreciated.
Thanks!
Don't delete. Once you "add" them to TFS, it creates an entry in the database just waiting for the files. Instead, undo your "add."
That's actually how to fix this problem as well.
Right click on any source file in the source explorer, and choose Undo Pending Changes. Uncheck everything except for the two files that you need to get rid of the add. Click OK to undo those changes.
That will clean up everything in the TFS database.

Resources