Get Local Version before the last check in - visual-studio

I am using TFS 2013 with Visual Studio online. Last day, I finished all my work and checked-in. There were some conflicts. I merged the conflicts and checked-in again. But when I open the app today, I found some methods missing. Is it possible to grab my local version just before the yesterday check-in?

This happens to me and my colleagues as well. After you merged the conflict, merged files are your latest local files. If you have decided remove your changes during merging, your changes are gone for ever.
You must pay special attention next time you merge files. This also give you another hint: Don't rely on tools. You're responsible for files you checked in.

Related

How to automate excluding deleted files on checkin?

I have a VERY large project which just went through an upgrade process. The upgrade is a process external to Visual Studio. As a result, files that are deleted by the upgrade process do not get properly detected by TFS so TFS pukes on checkin saying that it can't find the file.
The problem is that there are several hundred files that need to be excluded to resolve the issue. I could do this for days before I'm done. I'm pretty sure my boss would prefer it not take several days.
Is there a quick way to find and automate the exclusion of these files so I can just be done with it?
You have two options...
Use a Local Workspace - if you go into the settings of your Workspace you can change it from Server to Local. This will allow the changes to be detected automatically. You may need to copy everything out and then back in if you have already made the changes...
Reconcile the difference - You can use the TFS 2013 Power Tools and the "tfpt online /adds /deletes /diff /noprompt /recursive directory-name" command...How to have TFS 2010 detect changes done to files outside of Visual Studio?

File gets excluded every time the latest code is taken from TFS

Let's understand the problem:
For our ASP.NET project using Visual Studio 2013 premium on a Windows 7 x64
On developer A's machine:
We've got a TFS setup
We added a new file A in the project
We checked-in the newly created file in the TFS source control
On developer B's machine:
We've got the same TFS setup
We forcefully took the latest (by specific option - overwrite option) version
File A gets loaded in the project, however it stays excluded
Developer B manually includes the file in the project
The files are well included and that is our concern. Why files which're included are getting excluded on other devs' machines?
The newly added files gets loaded on dev B's machine however they doesn't show up in the solution tree. We've to manually include them in the project after show all files
There's only one mapping on each dev's machine. The code is going to locally mapped workspace only
We've a little big team, so for every developer. It happens every time we take the latest version.
How do we suppress this behaviour? Is there a setting as such?
We've tried searching the web, couldn't find a solution.
It seems TFS automatically excluded the changes. You may encounter such a situation as below:
They're not loaded in your current solution, so Team Explorer assumes they're made as part of either a different solution and
that you don't want to check them in together with the changes that
do match the context you're in.
They're made in a different workspace, again Team explorer assumes you want to check in groups of files that logically make sense.
More detail info please refer the very detailed answer from jessehouwing in this question What are "Excluded Changes" in Team Foundation Server?
And if you are working with a little big team, the way you are using to "forcefully" take latest is not a recommend solution. Suggest you to still use get latest to download the files on the TFS server. Even though you may not obtain the "really latest version" of the file. You can still work on it and figure out the conflicts if there are during the check in action.
Update
If develop A has checked in the files, but not checked in the project file( .csproj file), then TFS will not download them if you execute a "Get Latest" by right clicking on the project or solution in Solution Explorer.
You will however get the files downloaded correctly if you right click and "Get Latest" on the folder in the source control window. But, they won't get loaded into your solution, because you haven't told TFS that they belong there.

Get Latest misses new code in Team Foundation Server

This question is asking, "Am I doing something wrong," or "Is this a failure in VS2010 and TFS?"
Whenever I open Visual Studio 2010, I habitually do a "GetLatest" from TFS, and often have it overwrite my local files whether they are updated or not just to be safe. I want to make sure that any code I publish has the latest updates from other team members. Then we all check in our changes as soon as possible in order to stay in sync, as the entire team uses this practice.
What we are finding is that when NEW code is checked in (e.g. a new aspx with code-behind) doing a GetLatest will NOT grab the new files. All we get are updates to files that already exist in our local working directory. Are we doing something wrong? Is there a checkbox we need to tick somewhere to force VS 2010 to get files that are new rather than just update existing changes?
This is quite common and is the result of your local workspace getting out of sync. If it happens a lot you should delete the local TFS cache. That's in %profile%\local\Microsoft\teamfoundation*.
The best way to completely eradicate the issue is to upgrade to a newer version. This was resolved with Local Workspaces in 2012 and with Git in 2013. Its pretty strate forward to upgrade.

Visual Studio vs Source Tree. Pulling in a clear state and found uncommited changes

Is there any kind of problem between Visual Studio (v2008) and Source Tree?.
I commit some changes in a branch. Change to develop branch... Then do a pull. Pull is clean but when i enter Source Tree , it updates telling me i have uncommitted changes.. that i had not before!.
Checking them, it does things from a long time ago. I cannot compile... Where does it come from??.
I also found out that when you have a conflict, it saves the ORIG file and it does not delete it. Its annoying...
I found out an answer for this mistery:
Apparently, if you have Visual Studio opened (in some cases) and you open SourceTree. If you checkout other branch or develop branch and you were in another branch, Visual Studio does not understand files changed underneath and keeps track of old ones somehow.
That's why SourceTree finds you have some changes and files that are different all the time. No matter how many times you do "stash" to those changes, they will appear all the time.
So the way to fix this is to CLOSE visual studio and saying yes to update all files that have changed. Source Tree will no longer tell you you have uncommitted changes anymore.

AnkhSVN Merging Trunk into Branch

I'm trying to merge changes from a Trunk into a Branch. Previously when I've tried this everything has worked perfectly however in this instance the merge wizard has a cross next to "No uncommitted changes" and will not let me proceed. I've done everything I can think of to resolve this but as I have no entries in my "Pending changes" window I'm at a loss as to what could be the problem!
Any help or guidance on what to try next would be very much appreciated! I'm using Visual Studio 2012 with the latest stable 2.4 AnkhSVN release.
TL:DR - Downloaded TortoiseSVN and used it and VisualSVN server console to see exactly what was going on.
This was impossible to resolve with AnkhSVN alone. I downloaded TortoiseSVN and inspected the solution - turns out I had a tree conflict with one of my folders that had been renamed - logged into the VisualSVN Management server and deleted the "old" (original named) folder directly and pulled an update.
The next issue I discovered was the "obj" folder had somehow crept into the mix which was causing problems as visual studio loves updating files in here and so there were ALWAYS files to commit. Used TortoiseSVN to "Unversion and add to ignore list" on all the obj folders (Have about five projects in the solution that this had happened to!) and committed.
Once these steps had been taken I was able to update within Visual Studio using AnkhSVN and then use the AnkhSVN merge wizard to pull the changes from Trunk to Branch.

Resources