Get latest source code in TFS Visual Studio - tfs

I'm new to TFS. So, I have downloaded a source code from TFS last year. Recently, my team has made changes to the code, how do I get the latest source code that has been edited by my team. I'm confused between these two "Check Out" and "Get Latest Version".

You want "Get Latest Version".
To "Check out" a file or folder is to lock the file and prevent other people from changing those files - like how you "check out" a book from a library (other people can't use that book when you have it).
Compared to git where a "checkout" means to "switch my working folder tree to this commit".

Related

TFS: "Get This Version" vs "Rollback Entire Changeset"

I find myself needing to remote debug some deployed code, I have a clear changeset defined in tfs that is the code that was deployed.
My question is: What is the standard procedure in TFS to ensure my local code matches what has been deployed to live.
"Get This Version": I seem to recall that operation only checks out the changeset in question, leaving all other files in place, some of which have have been changed by another later changeset
"Rollback Entire Changeset": This one appears most promising, but I'm confused if it means 'Roll back TO this changeset', or if it means 'Roll back this changeset' effectively leaving the code in a state BEFORE that changeset was checked it.
Any clarification would be greatly appreciated.
According to your description, you shouldn't use rollback entire changeset feature. This will influence your source control in TFS. If you roll back a file to an earlier version, tfs will eliminating the effect of all changesets that occurred after that version. More details please take a look at this tutorial: Roll back changesets
Actually you just want to get an older version in history include all files for a branch or root project folder.
In TFS, you could Get Specific Version instead of get latest version of the branch. Details please refer this question: TFS Get Specific Version into separate folder
How to do this in VS: right click the branch-Advance-Get Specific Version. Have a look at my answer in this similar question: TFS source code explorer: browse specific revision

access local repository file instead of tfs file

We have a development server that is running TFS 2010, it is working fine however we have a bit of issue:
when person X take the latest and build the app , it get checkout abc.csproj application and due to that another person can't take the latest and it shows the error message as.
Here I'm looking for, whenever we modify any changes locally (pages) it should not get checked out & lock by TFS, only in their local repository it changes.
any suggestion would be appreciated.
There are two places you may need to change TFS to allow multiple check-outs.
In Visual Studio, use the "Team" menu, then "Team Project Settings", then "Source Control..." and ensure "Enable multiple check-out" is checked.
In Visual Studio, use the "Team" menu, then "Team Project Collection Settings", then "Source Control..." and ensure that if "csproj" is listed there, it has "File Merging" set to "Enabled".

Visual Studio Team Services Monitor User

So far I was working my my project myself using Visual Studio Team Services using VS 2012, everything was good. Now I have added another user for my project and things are NOT working as I expected, below are my basic questions.
After my developer is done adding/editing files, does he needs to tell me the ChangeSet # to refer to? so I can get his Check-in's?
How Can I see What files he modified/Added? And is there a way I can get only the changes I want from the user instead of getting his/her entire changeset/files?
"Get Latest Version" does not really gets me the Latest Version of files which my developer modified.
See below answers:
After my developer is done adding/editing files, does he needs to tell me the ChangeSet # to refer to? so I can get his Check-in's?
--> He doesn't need to give you Changeset# to get latest(his check-ins). You can go to Team Explorer --> Source Control Explorer and then right click on your project and select "View History" to look at all the changes done to the project. Do you see his changes in the history? If yes then "Get Latest Version" should work. Sometimes what happens if you try to get latest version in Visual Studio Solution and if the files changed are not part of solution you won't get those files. In those cases you need to get latest from Source Control Explorer.
How Can I see What files he modified/Added? And is there a way I can get only the changes I want from the user instead of getting his/her entire changeset/files?
--> If you double click on the changeset after following the above steps to go to View History you will see all the files changed. If you want to get only few files from a check-in you will have to get the latest at file/folder level instead of getting it at project level. i.e. Find out all the files changed using above method and then go to individual files/folders in the Source Control Explorer to get latest.

Taking my project to its previous state

I've a project added to my Team Foundation Server 2010 installation and I've done some code check-ins.
I need to restore the project to the point it was in the last check in, but, when I try to get the lastest version or a specific version, one of the files (File1.cs) I've modified is not checked out.
I realized that File1.cs was not checked-in the last time but I wanna roll back the project to the point it was in the last check-in.
What really does "Get lastest version" and "Get specific version"?
I'm very confused about these two options.
Get specific will get file at the given changeset. But if that file wasn't changed between the changeset you're at and the changeset you're getting, then this is a no-op.
The easiest way to find the version of the file you want to get is through View History. Find the changeset you want to get, and select "Get This Version". This will get only the file in question at that version.

Deleted a file out side Visual Studio, TFS doesn't recognize it

I am new to TFS. I checked out a folder from TFS using Visual Studio and then deleted bunch of files/added couple of files within that folder using windows explorer (actually I didn't do it, but that folder has third party libraries and I used an installer which made all these changes).
Now if I go to Visual Studio and try to check in that folder, I am getting this error:
Check in: Operation not performed
Could not find file : /ThirdPartyFolder/aDeletedFile.aspx
I tried to follow the solution proposed in this post, but that didn't work out:
http://www.woodwardweb.com/tfs_top_tip/tfs_top_tip_11.html
When I do 'Get Specific Version' and specified 'change set 1', it doesn't show the deleted files in red as it does in the screenshot of that blog post. Also, when I click OK, it shows the Pending Changes-Conflicts window with all the files that got deleted. Even though I selected "Keep Local Version", when I try to check in, I am getting the same error again.
Is there a way in TFS to take what is in my local version and over write what is in the server with my local version files?
I have done similar operations using Subversion, and this has never been a problem. Hopefully someone will let me know how to achieve this in TFS.
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. This is actually a useful feature - the server optimizes the data it sends you based on its knowledge of your local filesystem. That is to say, if you say "get latest", it knows your current versions and will only deliver the changes. If you're working with very large projects, this can be very efficient.
However, when other programs decide to make changes without pending the changes to the server, things can get a bit confused. Fortunately, TFS has the ability to detect changes that were made outside without explicitly pending those changes. You can use the "return online" capabilities of your TFS client.
You'll need the Team Foundation Server Power Tools installed, then you can simply run: tfpt online to detect those changes and select which ones to pend to the server.
(VS2012) Select the missing files from TFS "Check In" list and then right click on them and click on "Undo Changes" to exclude them from the list of "Check In"s forever.
This is one of the major differences between svn and tfs. Svn is somehow more integrated with windows shell and every change in your working folder will affect the server on commit. I propose you to perform any move, delete and rename actions within tfs UI, not from shell.

Resources