How to check in new project with tfs and intellij? - tfs

I use IntelliJ 13.1.1.1 and TFS when I try to check in a file with changes it say that there are no changes. Then I need to do a rollback and then check in and in most cases it works and the file gets a little gray lock icon.
When I try to check in all the project or rollback it doesn't work and say "no changes".
How can I check in all the project?

Go to View > Tool Windows > Changes.
Look at the "Local" panel in the "Changes" window.
Right-click (or manage...) the "Unversioned Files" node, and select "Add to VCS" from the pop-up menu.
Right-click again, and select "Commit Changes". Done.

Related

TFS is saying I have a file with status 'lock/edit' and I cannot undo it

In Team Explorer it says I have a file with the status of 'lock,edit' and the undo option is not enabled so I am not sure how to unlock this file.
I am the user who it is reporting that has the lock,edit but I can't undo it.
What options do I have?
You may have multiple workspace. Go to Source Control Explorer -- Workspace, to check whether you have multiple workspace. The change may exist in other workspace. You need to select correct workspace and undo the changes.
Another way is using TFS powertools. If you install TFS Powertools, you'll see Find by Status option by right click the locked file and select Find:
Click Find by Status -- Find, you 'll see the locked files list. Then right click the files and select Undo, the file would be released.

TFVC pending changes without checkout in TFS Everywhere

Using TFS everywhere. Editing files without "checkout for edit".
after it, unable to see edited files list in "TFVC pending changes" window.
Try to see if your project is Offline, that is the behavior when your project is not connected with the TFS.
1- Right-click on the solution name right at the top of the Solution Explorer and select the Go Online option
2- If that doens't help, please check your connections to the tfs through the Team Menu -> Manage Connections.
3- If still happens, try to restart the Visual Studio
You are using Team explorer everywhere. Try to check whether your project is offline:
Right click your project > Team > Return Online.
BTW, the project will be offline if you switch workspace to other that isn’t include that project.
Update:
Pending changes window > Click Actions > Detect Local Changes, then the modified file (tracked by source control) in current workspace will be included in Included Changes

Why do all my files have a red check next to them when I "check out latest" for the first time from TFS?

I'm going into TFS and creating a mapping to a local folder, then I right click on the folder I want to check out and click on "Get Latest Version". After I have pulled down all the files I open up the solution in VS and in the Solution Explorer window I see all the files (including the solution and project files) have red check boxes next to them. So now it looks like they all need to be checked in because I have made edits! This is not true, I'm checking these fiels out for the first time and haven't made any changes yet.
How do I check out the folder without it looking like there are already edits that need to be checked in? (no red check next to each file)
I had a similar problem (red checks next to everything in the Solution Explorer window). I resolved it by selecting the solution in the Solution Explorer, and then selecting from the menu bar: File > Source Control > Refresh Status. This removed all my red checks.
In Team Explorer (in Visual Studio): Tools | Options | Source Control | Visual Studio Team Foundation Server and select Show Deleted Items...
Then in source control explorer you'll see the items greyed out. You can right click on them and Undelete. (This option will only be available if they, after the undelete, will be included in your current workspace).
The red check marks indicate that there has been a change to the file. Many of these answers for previous versions of Visual Studio seem correct. I use Visual Studio 2017 and using GitHub.
If you have several files with the red check mark:
Right click project
Go to Source Control,
Select Commit,
{Follow standard commit procedure}
Enter your commit message,
Sync,
Push.
If there is just one file or you want to commit the files individually:
Right click each file
Select Commit,
{Follow standard commit procedure}
Enter your commit message,
Sync,
Push.
Right click project
Right click file
Identify Version Control Item Status in Solution Explorer
Checked out
Represents an item for which the current user has a pending change in their current workspace, and the item is not exclusively locked.
For me, the red X's were appearing because I had moved the files from a Feature branch to an Archived branch (After a successful merge into the main branch).
I tried File > Source Control > Refresh Status however this didn't help.
I didn't want to go messing with cache files.
I found this answer:
Go to Tools/Options/Source Control/Visaul Studio Team Foundation Server. Check if there is a check mark next to "Show deleted items in the Source Control Explorer".
I had to right click the particular folder and selected the "Source control" ->"undo pending changes" option.
Just spent 4 hours trying to rectify this and none of the solutions above worked for me, not even unmapping and re-mapping the solution.
In case anyone still has this problem, try removing your workspace and re-adding it.
Below are the instructions for removing and re-adding a workspace in Visual Studio 2019, but it should be similar for any other version as well:
Go to Team Explorer, scroll down and under Solutions you will see
Workspace: "Name of your workspace"
Click on the arrow next to it and select Manage Workspaces
A dialog box containing your workspace will open. Click Edit to see
the paths for Source Control Folder and Local Folder. Make a note of
them as it will be useful for re-adding the workspace. Close the Edit
Workspace window, select the Workspace and press Remove
Once it is removed, select Add then enter the paths that you noted
earlier. Press OK to confirm and it should re-add your workspace
without the check marks.
In Visual studio 2019, I have unloaded the project and I have reloaded the project. Then it went.
Working solution tested. It turned out very easy. Pending Add + sign or Pending Edit red check sign statuses on projects (below screenshot) of solution are git's statuses, this is very normal, and they will be disappeared after you "git add ." and "git commit -m 'messages'". Done!
After banging my head against a brick wall for 4 hours, it turned out I didn't want to delete the folders and files in the Source Control Explorer with the red X alongside them I had previously deleted, but merely toggle the Show/Hide Deleted Items button so it made them all disappear:
Highlight the adulterating red-crossed folder/file, and click the 2nd icon from the left in Source Controller menu that looks like an 'Xx'. For me, that's all I wanted to do. My offending files had actually been physically deleted from everywhere except from the documentary evidence that they had once been in the Source Controller. That sorted it for me.

Can anybody find the TFS "Unshelve" option in Visual Studio 2012?

I can find the shelve button okay, and had shelved changes earlier today, but now I can't seem to find a way to unshelve them! This has left me in quite a predicament!
If this button is in fact missing in the Visual Studio 11 Beta, perhaps there is a console based TFS command I can execute to temporarily accomplish this?
Thanks all, I actually can't find an answer on Google for this either.
Go to Team Explorer, then "Pending Changes", then "Actions", then "Find Shelvesets", then right click on the shelve you want to unshelve, finally "Unshelve".
Also :
File > Source Control > Find > Find Shelvesets
I always used to right-click on the solution and choose "Unshelve". To add this functionality back:
Click on the menu "Tools > Customize". This opens the "Customize" dialog.
Select the "Commands" tab.
Choose the "Context menu" radio button in the "Choose a menu or toolbar to rearrange" section.
Choose "Project and Solution Context Menus | Solution | Source Control" from the drop down.
Click the "Add Command" button. This opens the "Add Command" dialog.
Choose "File" in the "Categories" list.
Choose "TfsUnshelvePendingChanges" in the "Commands" list.
Click the "OK" button to close the "Add Command" dialog.
Use the "Move Down" button to place the new menu item in the proper place.
Click the "Close" button to close the "Customize" dialog.
Generally if you can't find an option among the thousands available in Visual Studio there is a very useful "Quick Launch" (Ctrl-Q) function.
In this case if you type "shelve" it will show you where to find shelvesets.
Just like to add to Nock's answer that you can only see the unshelve option if you open a solution under source control.
You will not see the option if you open a blank solution, regardless if your Visual Studio workspace is connected to Team Foundation or not.
This is how it looks like if you tried unshelving a shelveset in a blank solution (with TFS connected to your Visual Studio workspace and source control all connected), where there isn't an option to unshelve from source control.
This is how it looks like with a solution under source control opened.
Moral of the answer is to open any solution/project you may have that is under the source control which has the shelveset you want to unshelve.

How to undo changes in tfs coming from unmanaged workspace?

I have a workspace that is lost forever. I have some files checked out from this workspace. I want to unlock them but I can't. I tried to do:
TF UNDO $/MyProject/MyFolder/MyFile.cs /WORKSPACE:LOST;user /s:http://mysite:8080
But I got this message:
The workspace LOST;user is not on this
computer. Run get (get all if edits
were undone) on the computer hosting
that workspace to update it with the
change s that have been made on the
server.
Does exist any way to undo a file (not every file) checked out by unavailable workspace?
If the workspace is lost, then I would just delete it. Deleting it undoes any changes that were made in it.
tf workspace /delete WorkspaceName;WorkspaceOwner
As long as you have the appropiate permissions I would think that the method from this answer by #BubbleSort should work: https://stackoverflow.com/a/17870318/1982894
He used TFS 2012, I have tested it in TFS 2010 and it works there too.
Answer copied for easy reference:
(Note: I have the TFS Power Tools installed so if you don't see the
described options you may need to install them.
http://visualstudiogallery.msdn.microsoft.com/b1ef7eb2-e084-4cb8-9bc7-06c3bad9148f
)
If you are accessing the Source Control Explorer as a team project
administrator (or at least someone with the "Undo other users'
changes" access right) you can do the following in Visual Studio 2012
to clear a lock and checkout.
From the Source Control Explorer find the folder containing the locked file(s).
Right-click and select Find then Find by Status...
The "Find in Source Control" window appears
Click the Find button
A "Find in Source Control" tab should appear showing the file(s) that are checked out
Right click the file you want to unlock
Select Undo... from the context menu
A confirmation dialog appears. Click the Yes button.
The file should disappear from the "Find in Source Control" window.
The file is now unlocked.

Resources