I have a PC for Windows development and Linux box for Android development. Our source control is Subversion and I use TortoiseSVN on Windows and Subclipse plug-in in Eclipse on Linux.
Sometimes I'll edit a file for some experiment but I don't want to keep the changes. In Subclipse all I have to to is "Replace with latest from Repository" to bring it back in line with the latest committed code.
What's the equivalent of this in TortoiseSVN? Is there a simple one-step way to replace my local file with the current latest in the repository?
N.B. I don't want to do an "Update" because according to the documentation that will merge in others' changes. I want a complete replacement.
Thanks in advance.
I don't think there's a one-step action for that.
Right-click on working copy folder TortoiseSVN -> Revert & choose the files which should have their local changes undone, and then do a TortoiseSVN -> Update.
Use svn revert or the same command of TortoiseSVN context menu: http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug-revert.html and then svn update the working copy,
Ultimate solution: svn checkout a fresh working copy or do it though TortoiseSVN context menu.
Try Right Click the item > Tortoise SVN > Update to revision... > select Head Revision and you are done!!!
Related
I need to revert back to a local dev environment after having replaced it with the contents of an SVN repository? I'm using Eclipse Luna, SVN, Subversive, Spring MVC.
I would like to revert back to what I originally had as much was deleted from doing an accidental replace.
I'm not exactly sure what you mean by a "replace" but there are a couple of things you can try to restore the state of your projects.
Firstly, you have SVN revert. Right-click on the project in the Package Explorer, go to "Team" and then choose "Revert" from the sub-menu. This will give you the option to restore the state of local files based from Subversion.
If that's not what you're looking for then you've got Eclipse's built-in local history. Again, if you right-click on the project in Package Explorer then you should see an option to "Restore from local history". If you select this then you'll be presented with several historical snapshots of the files with which you've been working, so you can hopefully resurrect the desired state of your work from that.
my Mac is running:
Mavericks 10.9.3
subversion 1.8.9
subversion-javahlbindings 1.8.9
Eclipse Kepler SR2 with Subclipse 1.10
For some reason, when I'm working on a Project and go to Team > Commit
Subclipse will detect changes in existing files and allow me to commit, but it doesn't list added files.
In order to commit added files I have to use Team > Synchronise with Repository > Right-click on file tree > Commit
In the previous versions of svn/subclipse, added files were automatically picked up, and got committed straight from the Team > Commit dialog.
I've tried configuring Subclipse to use each oif the JavaHL and SVNKit options, but neither picks up newly added files.
Can anyone suggest what might be wrong?
In svn, new files must be explicitly added (using the svn add command) before they can be committed. Eclipse's Synchronize view does that for you, since it has shown you the files that need to be added and it presumes that you "approve" of the new ones. But using the Commit command directly is just calling svn commit without svn add, so the new files are not included.
When you create new files with other editor or copy/paste in finder, some times SVN doesn't detect.
You can try refresh the Eclipse project, just click in your project select "Team -> Refresh/Cleanup" from context menu, then the files will appear in Team Synchronizing View.
Works for me.
I am working with Java projects in Eclipse (Juno), using Subclipse for version control.
I've noticed that when I copy a file or a project, the resulting copy will not be under version control.
I can add the files to version control as a second step, but that will break their Subversion history.
Usually, I want to preserve the history: I want a way to copy files and projects in Eclipse that will issue a svn copy command.
How can I achieve this?
Update: I tried it on a project again; it seems that a svn cp was issued.
In which case my question becomes: how can I disable that?
Whenever I want to make a copy of code I use the branch feature, this would keep the history intact. It is available under (Right-Click on resource) -> Team -> Branch/Tag.
I am trying to adopt the following workflow:
git svn clone a svn repository through command line (egit doesn't support git-svn)
Open the project in eclipse with egit since I rather use egit to branch, merge, commit etc...
When i'm ready commit the changes back, I use use git svn dcommit to commit back to svn
I am having trouble with step number 2, don't understand how to import a git project, eclipse tells me i can't import it to use the same directory it's currently in because another project with the same name is already there. this is confusing.
Anyone knows how to do this ?
Also would like to hear other workflow examples that uses egit and git svn. I am aware that it is better to do it all through command line, however, I am trying to ease the move to git for fellow developers in my team, who are not used to command line interface etc...
I've worked briefly with the egit plugin (I actually recently stopped using it and just use msysgit as my Git guiclient and run it separately from Eclipse). I find Eclipse very busy as is and adding this plugin slows it down (for me at least).
What I did when setting up an already cloned project in Eclipse:
In Eclipse. File -> Import -> Existing Project into Workspace
Select root directory of project. Do NOT check copy projects into workspace. Click finish.
After project has been imported. Right click on project, go to Team -> Share Project
Select Git as a repo type, click next
Check use or create repo in parent folder of project. Since you already cloned the project it will be tracked with git. When you check this option it will show the project, the path, and the repo (.git).
Click finish and you will be all set.
I think you'd better use SubGit instead of git-svn.
SubGit works on a server side. It synchronizes all the modification between Subversion and Git repositories automatically on every incoming modification from either side.
From the client perspective SubGit enabled repository is a usual Git repository, so you may pull from and push to it. Please refer to SubGit documentation or SubGit vs. git-svn comparison for more details.
my project is connected to svn repository by eclipse plugin, and by tortoise, i used to checkout and update my code from both tools, the problem appeared when i needed to update tortoise, now i cant find any thing related to tortoise in the context menu from windows, its like i need to download the project again with tortoise .... is there any way to do it without re download the code... (i have many changes and cant commit from eclipse, need to use tortoise).
Checkout to a new directory, replace the files you need to update on the repository and then do the commit, that might be the easiest and safest way.