Whenever I add new file to my folder, I am expecting it to be shown in Pending changes include items but TFS does not show them as pending changes.
To check in new files I have to navigate to Source Control Explorer-> new file and add it to source control.
Is there any setting or way to automatically show new file in pending changes.
Related
Say I have files under TFS source control.
Some external process will
Delete some of the files (A) in the local directory.
Add some files (B) to the local directory - files which should then be tracked in source control.
Modify some files (C).
Now I want to reflect all changes in TFS source repository, that is, I want to
Delete files A from source control.
Add files B to source control.
Update (check-in) files C.
B and C are trivial.
But i dont know how to easily see the list of files A. i.e. the ones that have been physically removed from the local directory but are still under source control.
How to view the list of them?
And is there a TFS command to delete them from source control?
Edit:
Forgot to precise: I'm using TFVC, with a local workspace.
Because is TFVC and I guess you work with server workspace you can't delete local file and it will appear in the Pending Changes. you must to delete it from the source control also.
Just right click on the file and "Delete", then check in.
If you have multiple files that you local deleted and you want easily get all of them and delete them, you can right click on the folder and then "Compare", in the popup click "Ok" and you will get the differences between your local folder and the server folder. then right click on the files and "Delete".
How to view the list of them?
Team Foundation Server requires that you explicitly pend changes for these files - if you delete a file locally, this does not explicitly pend a delete against Team Foundation Server.
To list the those files, the best method is create a local workspace and not a server Workspace. If we create the local workspace and delete the file out of Visual Studio, we will receive the list under the Excluded Changes of Pending Changes:
If you are using server Workspace, you have to delete those files in the source control. To list this change file, you could use Compare option in the Source Control Explorer:
Detail steps:
Open the Source Control Explorer
Right-click on the folder with the changes and choose Compare
Also, you can use "Reconcile" feature to sync those file to the local/server.
Check this thread for some details.
And is there a TFS command to delete them from source control?
We could use Delete Command to delete the file from source control, but we have to specify the identifies the file or folder. If you want to delete those files deleted out of Visual Studio, I am afraid we could not do that, because there is no such argument to list those changed files.
Hope this helps.
When I click any node in the source control explorer, the contextual shows the option to undo or check in pending changes.
When I select either to check in or to undo changes, I'm getting a popup saying that there is no pending changes.
This situation is preventing me to add a new workspage.
Thanks for helping.
Even though there are no pending changes at all. Right click a folder or a file in solution explorer, the undo pending changes and checking in pending changes will still be black not gray.
So first, please make sure you have pending changes for the node first. You can use tf status command to display information about pending changes to files and folders in one or more workspaces.
List all changes in the current workspace
c:\code\SiteApp\Main\SolutionA\>tf stat
I have some files in a local workspace that were checked out and then deleted but were not deleted through TFS. TFS still has them marked as "edit" in the pending changes view. When I try to check-in the deleted files, I get an error saying the files cannot be found. Is there a way to tell TFS that these files have been deleted and that they should be deleted in source control as well?
You could, through team explorer, right click on the deleted files and do a undo pending changes. Then through team explorer delete them and check them in.
If that doesn't work - right click on the deleted file through team explorer; do a get specific version and check both checkboxes to overwrite files:
This will fetch the deleted [from workspace] file from TFS. Perform an undo pending changes on the file. Then delete the file through team explorer and check it in.
If there aren't too many files, just create some dummy ones on disk, check them in, then delete them through TFS.
I think you should be able to do this via source control explorer: View -> Other Windows -> Source Control Exlorer. Find the code file that you want to mark as deleted and right-click and select delete.
For future reference, TFS Power Tools is very useful for this kind of thing.
Is there a way either within VS2010, at the commandline, with a third party tool (preferably free), or with a script of some sort (Powershell?) to convert (within Pending Changes) a delete and add of a file to be a move instead so as to keep history intact?
Pending Changes means that the source control changes you have made are not committed to TFS. Therefore, the history has not been altered by the pending delete or pending add.
If you wanted the history to reflect a move, you should undo your pending change and create it as a move operation by using Source Control Explorer. Right-click on the file and select Move...
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.