This is rather weird. When I do a Svn update, tortoise tells me that I am at the last revision, but there are plenty of exclamation marks everywhere telling me that lots of files are out of sync.
I can delete the old files, update, then get the new version, but a mere svn update on the file, on the directory or any parent directory does not work.
The (!) red circle icon means modified, not out of synch (I don't think such concept exists in Subversion). TortoiseSVN is telling you that you have local changes that have not been committed to the repository. You can inspect them with the "SVN Check for modifications" context menu.
The /!\ yellow triangle means conflicted. TortoiseSVN already tried to merge incomings modifications into your working copy but it failed because they interfere with some of your uncommitted local changes. You can review conflicts with the "SVN Check for modifications" context menu and you can launch a GUI tool to fix them with the "Edit conflicts" menu.
Related
My team and I started a project at Azure and we have a git as the VCS/SCM.
One of my partners had made a few changes, and he had commited them. When I try to get those changes at my local repository, and I press sync at the Visual Studio, the following message appears
Cannot merge because there are uncommitted changes. Commit or undo
your changes before merging again. See the Output window for details.
The output window shows the message below
Cannot complete the operation because of existing changes to the
following file:Project\Project.csproj
I have searched everywhere at google, but I did not find anything similar.
Can anyone help me with this?
We are stack.
Thanks a lot
It probably means VisualStudio automatically added some references to the file ProjectProject.csproj, where it keeps general project settings. In VisualStudio 2013 you may do:
Go to the TeamExplorer
Select "Changes"
Search through Included and Excluded Changes, .csproj file is probably there
Right click on it and select compare with unchanged to see the differences
Now choose to commit it or undo the changes (if, for example, the changes are not necessary) to be able to sync with the current repository.
I had this same dilemma and it turned out that somehow the file that was preventing me from switching branches and was in my solution, was not being tracked like the other files were. I just added it to source control via the explorer window, committed and pushed it, then I was able to switch branches just fine. Hope this helps.
I am using Github GUI for Mac.
Now I've some changes in my local repository, but I want to ignore them and pull latest remote repository.
I tried Repository/Pull, but got Git Error.
"•error: Your local changes to the following files would be overwritten by merge:
Classes/xxx.m
Please, commit your changes or stash them before you can merge."
I tried Repository/Synchronize, but got following error.
"Sync Failed. Please commit all your changes before syncing."
Any idea?
Place a checkmark near each of the changed files, then go to the Repository menu and click Discard Changes to Selected Files.
If you mean using MAC GUI only, check and right click the changed files then select the discard the changes.
if you want to remove your uncommitted changes, just do a checkout on those files again.
Stash is super easy too though, and it keeps your changes in a local 'bucket' or stash :)
For those on Github for Windows, it is not obvious where Discard All Changes is, so I wanted to share this:
Select Files by using check mark next to names.
Right click on Collapse All/ Expand All button with two arrows. (This button is on right side of Files to Commit box, and under Sync and Gear icons.) This is where Discard All Changes is >hidden<.
Sorry but too low level to add comment to #Leo wangs or #aspiringwebdev chain above. You gotta start somewhere...
I'm working under a single repository and mostly in one solution.
However, during the work on the solution I do change other files as well, when I come to commit, however, AnkhSVN only shows the files that are part of the solution. That forces me to use TortoiseSVN to do the commit on the whole directory, which in turn misses some of the files that I added with AnkhSVN.
The simplest solution to this would be if AnkhSVN showed me ALL the pending changes for the repository. A worse alternative would be if AnkhSVN flagged added files so that TortoiseSVN would be also aware to them when doing commit from it.
Anyone knows a solution to these issues?
Thanks!
You can set an option to auto add files when new files are created that should be versioned by going to Tools -> Options -> Source Control -> Subversion Environment. Select "Directly add new files to Subversion" here.
Another alternative to make "New" files "Added" is the "Apply to Working Copy" command, available through the drop down next to the Commit button in the Pending Changes window.
In TortoiseSVN, there's a checkbox in the commit dialog "show unversioned items". If you check that box, the files that are not added yet are shown as well.
You can right click the svn folder then TortoiseSVN-->Add , will show all the items which is not included for supervision.
check the screen shot
How do I undo/revert a change I've commited, with AnkhSvn/VS 2010.
(I'm well aware you can't "delete" stuff in the subversion repository).
The issue is simple,
You're working on HEAD(e.g. rev 100). You figure out something is broken. You view the history, and figure out rev 93 might be the issue. You want to revert the change done in rev 93, test, and commit those reverted changes.
While I know how to resort to the command line to "undo" this, How do you do this with AnkSvn from within Visual Studio ?
Go to the history viewer (Right-click solution -> View Solution history), here right-click on a revision (or a selection of revisions), and use the items in the context menu to undo your changes.
I use the following process:
With the solution working on the trunk HEAD and with no local files, right click the Solution, go Subversion -> merge
The Merge Wizard will pop up.
On the first page select 'Merge two different trees'
On the second page you want the 'From' to be the HEAD (Latest Version) and 'To' to be the specific revision to roll back to (93 in OP case) and using the 'From' URL.
On the third page, for text and binary conflicts I have 'prompt me for each' selected. I have depth as 'working copy' and leave 'Ignore ancestry' and 'allow unversioned obstructions' unchecked.
On the final Merge Summary page perform a dry-run first, check to see that the changes look correct. Then run the merge.
Finally, commit the changes to the trunk.
AnkhSVN wasn't working when I did Update to a Specific Version, I kept getting an error message about "please update the out of date items and then retry commit". After some trial and error I figured out how to undo a committed file using the command Revert to this revision.
Say for example you are at revision 4440 and you want to make 4435 the new head. Use Revert to this revision to discard all changes after the selected revision.
How to make a prior committed version the new HEAD revision
NOTE: You may want to revert an entire a solution, but keep a couple changes made in the "un-done" revisions. If that's the case before you revert you could: copy out the newer files to a temporary location, do the revert, then copied them back in to revert everything but keep a few changed at the desired state.
Below is how to undo/revert a committed change with both ANKH and Tortoise.
ANKH
With solution open in Visual Studio, Right click context menu (this can be a Solution, Project, or any specific file) > View History > Select revision > context menu > Revert to this Revision.
ToirtoiseSVN
In file explorer right click on the file or folder (this could even be the top folder if you want to do a mass undo): Show Log to display a list of revisions, select a revision, then select Context Menu → Revert to this revision. Then at the top folder level do Commit, and all of the items will be reverted.
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.