Lost changes in TFS - tfs

On Commit found many conflicts in files after taking latest, so I remove mapping thinking remap somewhere else and paste my old local changes in latest version of TFS but remove mapping remove all files with my latest changes.
I have remapping my code somewhere but please help me that how I can find my old changes

I haven't resolved for conflict, but just remove mapping and bind again for somewhere else,
but after remapping binding again to my original first path no loss I found there,
all checked out files were remain same...
might be helpful for others

Related

TFVC source control binding invalid when migrating to new workspace

I'm switching to a new machine and would like to keep my TF files as they are. Thus I simply copied the entire folder to the new machine's (same as the previous one - C:\TF), mapped it to the TF server's root, and attempted to open a solution from the file explorer, hoping that it would bind more or less automatically.
I then ran into issues similar to others that have been described elsewhere, such as here and here. VS/TF insist that the binding on the solution and all projects is "invalid".
Unbinding and re-binding does not work, the binding reappears but remains invalid.
Recreating the workspace does not work.
There is nothing funny about the solution file's content.
The relative paths are correct - if I remove the bindings and try to add the files to source control, it overwrites the already existing files in the source control explorer (the item previously appearing as a grayed-out "Not Downloaded" becomes white with an "add" pending change).
Tried mapping the workspace to a "fake" network drive that pointed to the new machine's hard drive (just in case TF was mixing up the identical paths), still the same.
Deleting Team Foundation's AppData settings doesn't work.
When I perform a get on the solution folder, though, the binding becomes healthy all of a sudden. In the end I performed the get, deleted all the new files and put the ones from the old machine in their place. VS/TF apparently had no issues with the binding then. It's a rather inconvenient way of achieving that end, though.
I'm forced to conclude that TF doesn't want me to bind my own, local files to source control without first performing a get in that workspace, even if the file paths match what is on the server. Question: why is that? Am I doing something conceptually wrong? Doing it the wrong way? Is this behavior an idiot-proof feature of the tool, or just a limitation?
You're doing it wrong :/. | it's a feature, not a bug.
The workspace is registered on the VSTS/TFS server as well as in the local workspace cache. After moving the folders over to a new machine (and to the same folder location), you need to tell VSTS/TFS the new computer name these files now reside on.
You have to run tf vc workspaces /updateComputerName:oldComputerName workspacename to update the workspace registration on the server.
But I'm afraid you need to do this before overwriting the workspace with a new mapping.
Now I think the only option is to use the Unbind option, save all, then open the source control menu again and rebind all the projects in the solution. Or edit the solution files manually (there's a tool for it as well).

Can't check in changes to TFS

I am having issues trying to check in changes to TFS hosted on Visual Studio Online. Started just last week. I am running Visual Studio Professional 2017 version 15.5.2.
When I try to check in changes, I get this error:
C:\My\Workspace\Path\Project\File.cs: Download of item $/Workspace/Path/Project/file.cs was not completed. Perform a get operation to correct.
Okay, whatever. Sounds simple enough.
So I go to the problem file and do a Get Latest Version.
When I do that, I then get this error:
Source Control Explorer
The network path was not found.
The output in the Output window after attempting the get is this:
Conflict C:\...\...\...\...\...\Program.cs - Unable to perform the get operation because you have a conflicting edit
Automatically resolved conflict: edit: C:\...\...\...\...\...\Program.cs as TakeTheirs
The network path was not found.
I have read a number of posts, and tried a number of things. None have fixed the issue. Things I have tried...
Delete the TFS cached under AppData. Did nothing to help.
Disconnect VS from the TFS project, then delete the hidden $tf folder under my local workspace and then reconnect VS to the team project and re-get everything. The initial re-gets all worked. But once I made some changes to a project and then tried to check it in, it started with these errors again.
Anyone have any other ideas? The next step I see in my future is having to uninstall and reinstall visual studio, but I'm REALLY trying to avoid that.
So, the solution is Deleteing and recreating the workspace.
You will meet similar issues when a workspace is messed up.
Generally, you can try below item to fix such an issue:
Disconnect any instance, close VS, then delete the cache folder located at: e.g. %localappdata%\Microsoft\Team Foundation\7.0\Cache, then restart the VS, connect to TFS/VSTS again.
Remap the workspace to a new folder
Delete the old workspace and create a new one, map it.
By the by, ... I had this issue again today, and had a slightly different fix. When I went to delete my workspace, I found that a prior aborted new project had somehow added additional working folder mappings to my workspace. So I deleted those, after which VS said it needed to restart. So I let it, and now everything seems to be working fine.
Just figured I'd let people know, in case they find that situation, so they needn't go through with the whole other drastic measures, to check this first and try it if it applies.

Bulk resolve merge conflicts in tfs

I have my source control data on a separate partition.
When I rebuilt my machine I pointed my work space to the old location.
Then I did a get latest and was confronted by a lot of merge conflicts that couldn't be resolved by auto merge (A non version controlled file or writable file by the same name already exists locally).
While I can resolve each conflict there are a lot of them.
Can I bulk resolve these conflicts?
Firstly, this is a pain don't do this.
Shelve all your change-sets so you can wipe the mapped folders and start again.
To bulk resolve just select all and click the resolution.
It is my opinion that the UI does not make it clear you are resolving all item.

Git - what does CONFLICT (rename/delete) mean?

I did not find much success in understanding what this means in other SO questions.
this is for a ruby on rails project. it's probably really straightforward if you know what to do. I tried merging two branches and this was (part) of the result.
CONFLICT (rename/delete): db/migrate/20160705073411_create_building_employees.rb deleted in HEAD and renamed in user-authentication. Version user-authentication of db/migrate/20160705073411_create_building_employees.rb left in tree.
Removing app/models/buildings_user.rb
Automatic merge failed; fix conflicts and then commit the result.
There were a tonne of files which were marked as "modified"
there was one 'unmerged' path. Namely:
added by them: db/migrate/20160705073411_create_building_employees.rb
when I opened up the file i saw nothing to really resolve. there were no asterix running across the page.
What does the above mean?
How do I resolve the issue?
Any advice would be much appreciated.
The error "Conflict (rename/delete)" means that a file was renamed in one branch and deleted in another(create_building_employees.rb deleted in HEAD). This type of conflict is not with the content of the files themselves- but with the directory/tree of the branches. You should use Git Mergetools to do a diff between the branches and then make whatever modifications needed
Here is a great thread on resolving conflicts How to resolve merge conflicts in Git?
And see the blogpost: http://weblog.masukomi.org/2008/07/12/handling-and-avoiding-conflicts-in-git/
This conflict message means that some files were deleted in one branch and renamed in the other. You need to decide for each one if you want to remove the file or to keep it (with the new name).

Why is TFS asking to resolve conflict after get specific version

I am downloading a specific version of a branch but keep getting prompted to resolve conflicts after the download is complete.
Before I call get specific version, the state of the branch is "not downloaded", I confirmed this with file explorer, the folder does not exit locally .
I have also checked Overwrite writable files that are not checked out and Overwrite all files even if that local version matches the specific version in the get specific version Get dialog.
If no local files existed before the call to get specific version what is the server version conflicting with?
Surly any conflicts would have been resolved when that change set was initially commit-ed, the change set cannot be in a conflicted state on the server?
Removing the mapping from the root directory and then adding it back again solved this. There must have been a conflict between the actual files and what VS thought was there.
Still don't know why it would try to merge in that situation though. Surly the state of the actual folder should take prescience over whatever VS thought was in there.

Resources