TFS 2010 - Undo "Get This Version" Action - visual-studio-2013

So i click on Get This Verision (A really old one) under history by mistake and now my project has my new recent changes plus this very old changeset, but I am not sure what else might have changed (i see some of my new files created after this version with an exclamation mark)??. Is there a way I can undo the action of Get this version so my solution only has the changes I have been working on. Any help is appreciated thank you!
UPDATE: is it as easy as clicking Get Latest? That seemed to do the trick but now I still have all these conflicts to resolve from. Do i click Keep Local Version even though the description of that button says This option will replace the server version with the content from your local version. I do not want to replace the server version. I want to keep my local and leave the server version of this changeset alone

Yes, it's as easy as clicking "Get Latest". The message you're seeing is misleading. "Get Latest" only affects your local workspace, it doesn't change anything on the server side at all.

Related

Get Latest will give an error if file is Not downloaded

When Source Control Explorer shows that a file is Not Downloaded, selecting Get Latest Version will result in the following:
I don't remember this happening in the past. Is there a way to prevent this?
This kind of error or situation may occur when using "Get Latest Version" after someone else has just added a new item to source control.
For example, it seems to be triggered by multiple people working on the same solution at the same time. So if you check stuff in, then the other user gets this message when doing a "Get Latest". It appears Visual studio is detecting the files that were checked in by the other user and then pulling them in the background but not updating the local workspace data, so when you do a Get Latest, the files already exist, but it gets confused as to the source control status and throw this because it's confused.
One solution for this issue is closing your Visual Studio and clear TFS cache. Then open the Visual Studio and get latest for this file again.
Another way is directly removing the work space and create a new one then tfs will prompt you to download everything again. https://msdn.microsoft.com/en-us/library/ms181386(v=vs.100).aspx This should do the trick.

How do I download last working project from TFS server and replace my local, which does not work?

Apparently I have some problems with my local work-space and I not able to deploy anything to TFS server successfully.
Is it possible to download last working solution and replace my local?
If so, how?
Thank you for you help in advance.
In the source control explorer, right click on the folder you want to replace, navigate to "Advanced", and choose "Get Specific Version".
(Assuming you use TFVC and not git...)
yes, of course, you can. do you know the type of your workspace (local\server)?
in any way you can get specific version from the context menu, then choose the latest version: enter image description here
if you want, you can delete ALL local content before, make to select the checkboxes to overwirte the local and ignore the disk
If your workspace is large, you can use scorch command instead:
tf vc scorch
this command checks the disk with the server and removes untracked files

TFS in Visual Studio - How to get server repo to match local repo

Disclosure: Newbie with TFS and couldn't find useful SO answers
A coworker submitted a bunch of changesets to source control -- Can I just get the most recent one to get all of his changes? Or would I need to get each one individually? In other words, do changesets compound?
And more generally, what's the easiest way to ensure my local repo is identical to the server repo (minus the new things I'm working on).
I'm much more familiar with Git if that would help explain this
With your source control set to TFS in VS (Tools > Options...) just right click on your project file in Solution Explorer and select Source Control > Get Latest Version (Recursive). I do it twice just to make sure I get a message saying "up to date".
You can also use Source Control Explorer and get a specific changeset by right clicking the change set and selecting a similar option, and yes, these will get all changes up to the one you clicked.
Edit:
A little confused rereading your title it sounds like you want the server to match local, then your question is about matching your local to the server. So let me address both.
To get the server to match your local this would be most like a "Check in" (or 'push' in Git) this will merge your files into the server. You can perform a check in by clicking the Team Explorer tab and selecting "Pending Changes" then type a description and click "Check In". Where there are conflicts your will be notified and asked how to proceed, but in most cases following best practices this will not be the case.
Then you will want to match your local with the server (basically a 'pull' in Git) by right clicking the project file and selecting 'Get Latest Version (Recursive)'
Hope this helps.

Xcode Subversion (SCM) Difference between Refresh and Update

I have configured Xcode to use Subversion (hosted on a remote webserver - Beanstalk.com).
In Xcode menu under SCM, I want to know the difference between two options
1. "Refresh Entire Project ..." and
2. "Update Entire Project ..."
Please help.
Thanks
Dev.
Open the SCM Results window from the SCM menu item, click on the little 'text' button on the left-hand-side (might be at the bottom of the window to start with?), expand it so you can see a little more, and then run refresh and update to see what commands Xcode passes to SVN.
Sorry, can't speak for SVN right now, but for CVS it did this for me:
I believe Refresh will check the repository if there is a newer, updated version of any files within your project that may have been committed by another developer since your last checkout.
Opening your SCM Results view will show you in the 'Update' column what files have been updated since your last checkout with an 'M'.
If you select Update, you will actually pull down those files and update your current project while Refresh will just check the files and list them in the SCM results window without downloading and overwriting your file.

How do we keep track of our working copy's branch?

Are there any good techniques to help us know which branch (or trunk) our working copy is from? We recently converted to Subversion and we're using release branches. I had two developers commit changes to the release branch that should have been committed to the trunk. We're using CI (TeamCity), so I recognized the problem right away and was able to revert the changes but I'd like to prevent it from happening again. From within Visual Studio, especially, it's easy to make a mistake and commit to the wrong branch.
We're using TortoiseSVN and AnkhSVN.
Edited to add:
Just to clarify, I'm looking for a method to prevent careless mistakes, I already know how to find this information. There are two careless mistakes I'm trying to prevent:
Doing work on the wrong branch. If this is caught before commit, the developer has to merge the changes back into the correct branch.
Committing to the wrong branch. This combines the pain of point 1 with having to revert the changes in Subversion.
Edited to add: We just made the switch to the VisualSVN VS plugin and it has a toolbar that displays the path of the current working copy. I really like the reassurance that I'm working on the right branch.
Perhaps you should consider using a pre-commit hook: http://svnbook.red-bean.com/nightly/en/svn.reposadmin.create.html
Then you could do something like only approve checkins that have 'for release' in the comments for that particular branch or something like that and return an error message otherwise.
In AnkhSVN (in Visual Studio) the project url of your working copy is from is displayed in the 'Working on' field of the Pending Changes Window (View->Pending Changes).
The url of a file/folder is also displayed in the Visual Studio project window when you select a file in the Pending Changes Window or Working Copy Explorer (and in many cases even when you select a file in the Solution explorer; but this depends on the project type).
[Update: I just added AnkhSVN issue #581 for extension of the commit dialog.]
Tortoise SVN adds columns to the Windows Explorer view. In "Details" mode, right-click on column headers to get a list of available columns, at the bottom, select "More" to get a dialog of all available column types.
SVN short URL should quickly show you what the location is in the repository.
But this doesn't appear to work under vista ...
Right click the folder, move to the subversion tab, there it says the project it's linked to.
Also, in the commit dialog, it says so at the top of the dialog.
From the working directory:
svn info
URL will contain the branch your working directory points to.
<EDIT> Seeing how many people dislike the command line, the closes thing I found from TortoiseSVN is the "repo browser" which seems to use the selected branch as your starting path in the repo. </EDIT>
Avoid re-using working copies. If you're working on 2 places in the repository, have 2 working copies, named appropriately, like: Project-trunk, Project-release.
Here is a simple idea which might help:
Create an empty text file named "branch_XX" (or any name) and add it to your branch.
commit this and then when you switch to the trunk, the file will not appear in the solution explorer.
It sounds stupid... but it does the trick.
I really hope they will add something that might mark what branch we are using without going to other windows.
In AnkhSVN (in Visual Studio), right click on your project/solution, then Source Control -> Subversion -> Select in Repository Explorer. It will automatically select the branch you're currently working on (i.e. the branch you're switched to).
I don't think that the accepted answer for AnkhSVN works for Projects, since I always see the same URL in the "Pending Changes" even after I use the option "Switch Project" on a project.

Resources