I followed the instructions in this Microsoft article, but they don't work.
I created .tfignore file, put it in the root, here its content (I want to exclude these folders).
When I open Team Explorer - Pending Changes, I see these folders are included in Pending Changes
A way to solve the issue is updating your VS to VS2015Update 3. The .tfignore should be indeed working correctly.
If those files already in the pending changes before you add your .tfigonre file in source control. You can try below solution:
If the changes are "still" in pending changes, first create a backup
copy, then make an Undo on them. Close VS, restore the backup copies
and then it should work.
Or you can try to use a temporary quick fix for the problem:
Add an $ char into the bower_components folder name in the .bowerrc. TFS does not allow the $ character in the file name, so it can't be added to source control.
More detail ways you can refer this blog from GitHub: Things in ".tfignore" still are shown in pending changes
Related
Had to move my directories for the local workspaces for Visual Studio. I updated the directory locations in VS, but it acted as if they were completely out of sync, and asked to get latest.
I let it do so for one project - it (re)downloaded everything, came up with a list of files to which I had local changes, listing them as conflicts. I kept the local version of all the files, so no work was lost. But when I opened the project, those files came up as not being in source control, and it offered to let me add them. So again, I have all my work, but that's a tedious process to re-connect everything. Not to mention that I'm not sure I caught ALL the files that needed re-adding.
I've also considered copying everything to other directories, download a clean copy of the project(s), doing a compare and folding in my changes. Still messy, but possibly safer.
Is there a far better way to do this practice that I've missed? Perhaps as a side question, is there an easy way to list all the files in a project not in source control?
Guess you moved/changed local TFS workspace folders in file system directly. This caused some folders/sub-folders/files lost mapping.
In other words, all of these folders already out of source control. That's why you need to re-add or re-connect them to TFS source control.
A right way please refer how to move an item in TFVC:
You can use Source Control Explorer to move one file or folder at a
time. You should not use Source Control Explorer to move folders or
files that are referenced by a Visual Studio project or solution. Move
these files with Solution Explorer instead and check in the move in a
new changeset.
In Source Control Explorer, select the item that you want to move,
open its shortcut menu, and choose Move.
In the Move dialog box, either manually type the destination for the
item in the To box, or choose Browse to use the Browse for Folder
dialog box.
Choose OK.
Move is actually a delete and re-add process. You could also take a look at this similar question here: Moving project (under source control) to different folder
In your situation, a quick way to solve the conflicts should be: First back up your local files, delete your old workspace, create a totally new workspace. Get latest version from sever side to your new workspace.
Then copy your back-up files/folders which copied from old workspace folder to the new one. Windows system will judge to replace files and add new files.(It may take some time) After this, TFS system will auto detect the changes in local and will list them as new pending changes. Some new add files maybe stay in the Excluded list, manually promote them in Included list.
Finally check in all your pending changes, everything should get back on track.
I have just upgraded to VS2015 and I am experiencing an issue I have not seen before. Using an existing solution under source control, I am able to modify files and they get picked up as pending changes ready to check in to TFS.
However, I add a new file (Test.cs as an example in this screenshot), it is not picked up as a new file.
I am required to right-click it and click "Add files to Source Control"
This has never been an issue before. I would like everything I add as a new file to be picked up as a pending change. How can I make this happen? I have not seen this before in previous Visual Studio versions.
I can confirm that this issue is the same on another machine. Also, the new file is not picked up in "Promote Candidate Changes" either.
If I then click "Add file to Source Control", I get this message.
"The selected file is ignored. Add it to source control anyway?"
My .tfignore file just has a directive to ignore packages, so I don't think this file is the problem.
How can I get my settings back on track?
UPDATE:
I have noticed that this only happens to the "Release" branch of my workspace. All other branches behave as expected. Furthermore, if I then take a branch "Release" and call it "Release1", the issue goes away entirely!
Do branches with the specific name "Release" take on any special functionality in TFS?
Folders called Release and their contents is automatically excluded from TFS (along with Debug and lots of file types). You can override this for particular folders by creating a .tfignore file, as detailed in the "Customize which files are ignored by version control" section of this link
Customize which files are ignored by version control
By default certain types of files (for example, .dll files) are
ignored by version control. As a result:
When you add ignored files to folders that are mapped in a local
workspace, they do not appear in the Pending Changes page in Team
Explorer.
When you try to add ignored files using the Add to Source Control
dialog box (for example by dragging them into Source Control
Explorer), they automatically appear in the Excluded items tab.
You can configure which kinds of files are ignored by placing text
file called .tfignore in the folder where you want rules to apply. The
effects of the .tfignore file are recursive. However, you can create
.tfignore files in sub-folders to override the effects of a .tfignore
file in a parent folder.
.tfignore file rules
The following rules apply to a .tfignore file:
# begins a comment line
The * and ? wildcards are supported.
A filespec is recursive unless prefixed by the \ character.
! negates a filespec (files that match the pattern are not ignored)
.tfignore file example
Ignore .cpp files in the ProjA sub-folder and all its subfolders ProjA*.cpp
Ignore .txt files in this folder *.txt
Ignore .xml files in this folder and all its sub-folders
*.xml
Ignore all files in the Temp sub-folder \Temp
Do not ignore .dll files in this folder nor in any of its sub-folders !*.dll
We were also experiencing this issue but in our case it was because we had folders that ended in ".Lib". Figured it out from this SO question: Visual Studio 2015. Files not added to TFS
We have the same issue because of a branch called 'Release'. But the issue is only at Visual Studio 2015 Update 3. Using Visual Studio 2015 Update 2, everything is ok. So Visual Studio Update 3 must have been changed its behaviour. It would be useful to return to its old behaviour.
Add a .tfignore file to the release folder containing the extensions you want it to not ignore:
!*.vb
I tried adding this to the .tfignore that existed in my solution folder and it didn't help. It only worked when I added one to the parent release folder.
..\Release
..\Release\.tfignore <-- this one
..\Release\SolutionA\
..\Release\SolutionA\.tfignore
msdn thread on the subject
I remember that in the past I was able to Exclude selected files from Source Control. But now this is missing:
How do I get it back. I want to exclude permanently, for example the photos folder.
This feature can now be found in the Pending Changes window:
You must first undo any pending changes on this item if there are any.
And you can specify a .tfignore in your source control system to make TFS automatically ignore files (the above mentioned dialog will create or update this file through the UI)
Somehow, due to folder renamings and various other source code changes, I'm having an irritating problem. I'm showing a pending change for a file that cannot be undone in TFS.
This is a little hard to completely explain. Here is what the directory/file structure looks like in TFS:
RootFolder
Folder
FileA
FileB
OldFolderThatWasRenamedToFolder (shows add icon)
FileA (shows "edit" pending change)
"OldFolderThatWasRenamedToFolder" had been renamed to "Folder" and is committed to TFS like that. The "FileA" under that non-existing folder references the same file as "Folder/FileA" but registers as a different file; for example, if I change "Folder/FileA," pending changes are shown for both "files." Whenever I undo pending changes for the phantom file, TFS reports the error:
No pending changes were found for .../Folder/FileA.
I cannot get rid of this annoying false pending change. I've done an update in the folder forcing an overwrite and even deleted the folder prior to the update. How can I eliminate this phantom pending change?
Update:
I found a potential clue. When I compare the "pending" file with the latest, no changes are detected, but when comparing with the "Workspace version," the file is compared with an older version of the file. I've recently tried deleting my workspace and creating a new one, but the same problem persists. What exactly is going on? Where are these pending changes even stored? Is there some file I can manually edit?
In visual studio 2010, you can right-click on the phantom pending check-in on the "Pending Changes" panel and click "Undo..." on the popup menu, then click button "Undo Changes" on the dialog box "Undo Pending Changes", the phantom pending check-in will be removed from the list.
You should be able to undo the pending change with a 3rd party tool called TFS Sidekicks.
It is a free set of utilities by Attrice. I use it especially when I (or a client) come across such problems, as well as permissions issues, and the like.
Moreover, the tool will allow an administrator to do the same for other users. That means that it will solve situations where code is marked as checked out by a user that may no longer exist in the system.
Download it at http://www.attrice.info/cm/tfs/index.htm
Hope this helps.
I figured out a way to fix this using the tf.exe command line. By entering this:
tf undo /workspace:MyWorkspace $/.../RootFolder/OldFolderThatWasRenamedToFolder/FileA
...I was able to undo the pending change. If anyone knows how to do this same thing without resorting to the command line, I'll accept their answer instead.
I know this is an old post, but I expierenced the same thing.
What I found: John Kurlak's command line worked for me. I wanted to try something so I ran the TF MERGE again. This time I closed all Visual Studios open and then reopened it. The files showed up in Pending Changes and was able to Undo from there.
I know this is an old question, but I just faced that issue and I was not able to figure this out with sidekicks or tf command line tool. In my case the solution was close the solution and delete the .suo file.
John Kurlak's comment helped me a lot, but let me describe what issue happened in my case and how I solved it.
I've tried what he has suggested:
I opened the developer console, did a cd to the directory of my branch, and ran:
tf undo * /recursive
Then selected "All" when the tool asked "Undo your changes...? (Yes/No/All)".
In my case that was not enough, because NUGET left some files which were not added to TFS. That caused the tf tool to abort with the error:
TF400024: The change on
C:(SomePath)\themes\base\images\ui-icons_cd0a0a_256x240.png cannot be
undone because a file already exists at
C:(SomePath)\themes\base\images\ui-icons_cd0a0a_256x240.png. The file
must be deleted from disk for the undo to succeed.
In this case, I had to delete those files mentioned manually, and then retry until it succeeded. That had to be done a few times.
Note:
Those files can be found easier in the file explorer if you have the TFS power tools installed, because the files belonging to TFS have a green triangle in their icons, the other filies (the ones you need to delete) not.
I had a similar issue with a project that is stuck in AX version control/pending objects with “Add” action. I could not get rid of it by clicking on “Undo checkout” because it no longer exists in AX projects, local repository, nor in VSTS. To get rid of it, I created the project in AX/projects/shared then was able to get rid of it by going to AX version control/pending objects and clicked on “Undo checkout”. I believe this occurs when you create an object in AX, add it to version control, then rename the object afterwards. Hope this helps.
I am still new to VS2010, but this is how I fixed this issue for me:
Go to Source Control in the Team Explorer panel. In the Source Control Explorer, right-click the directory, project, or source code file for which there are pending changes to be ignored. Select Undo Pending Changes. A modal dialog appears confirming the Pending Changes that will be undone. Select Undo Changes, and voila! No more phantom pending changes.
I created a folder in a TFS Project under workspace "CPortalWS". I deleted the workspace, but now I would like to delete the folder in the project and the delete option is not available.
I've tried to create a new workspace mapped to the project but I still don't get the option to delete.
Is this a bug in TFS? How can I delete the folder?
Any help would be appreciated.
Deleting a folder in TFS is a little strange.
You have to:
Create a Workspace
Get the latest source for the folder (to your local machine)
Inside Source Explorer, delete the folder
Check in your changes (this is the step that deletes the folder in Source Control)
only note that delete is not an actual delete.
the folders/files are still there and kept in Version Control, for example for Undelete scenarios.
You can see them and avail the undelete function if you go to "Tools > Options > Source Control > Visual Studio Team Foundation Server" and check "Show deleted items in the Source Control Explorer" and then right-click on one of the deleted folders.
so, if you want real delete, where the folder/files actually go away you need to use the Destroy Command which is only available from the command line, see link below
http://msdn.microsoft.com/en-us/library/bb386005.aspx
When you delete in TFS, it does not remove it from TFS. It maintains a copy of the deleted files, even when you check in the deletion. This can cause some issues.
To permanently delete from TFS, you need to issue a tfs destroy command.
To do this:
Open a Visual Studio Command Prompt.
Issue the following command: tf destroy $/SourceLocation/Folder. Where $/SourceLocation/Folder is the Source location of the deleted folder in TFS.
Please note: This command will also delete the file(s) from disk.
I had a similar issue, where I had 1 folder which despite being deleted from Hard drive, was still showing as in Source Control (with a green + by the folder). It also showed me the content but if I tried to open any, an error message informed me the file wasn't there.
Clicking on any folder didn't show the delete button. I then realised that selecting a file did! If you don't have a file, create a text file and add it to the folder you want to delete (via Source Control). Click this file, note the delete shows. Select a folder and note that the delete disappears but only after half a second. This small delay is actually usable.
I clicked the file, so the delete button is enabled and hovered the mouse above the delete button. Using the keyboard, I did a CTRL + A and as soon as all files and folders were selected I clicked left mouse button. And it worked! Everything was removed, including (and this is the odd thing) the parent folder.
Create a Workspace; and get latest on the base folder; Dont forget to cloak the relevant folders. If you are going to delete the subfolders then cloak all and get latest on the base folder. So you save a lot of time in pulling files.