Eclipse, import project but don't copy - windows

I use Linux as primary operating system and I also have to work on a Windows virtual machine with Eclipse 3.7.
We're working with subversion but with Linux I'm happily using git-svn with Emacs+magit, which works great.
So I would like to be able to work on the same code from both OS, and only do the real version control management on Linux.
So I had the following thought:
1. share the directory with virtualbox
2. create the projects pointing to the shared directory
Well that doesn't work, because the dumb thing wants to copy everything.
So I tried to use virtual folders which seemed a good idea, but now some scripts are badly failing because they don't find the hard-coded paths.
So I don't know anymore what to try, any idea?
EDIT:
My last attempt in the last edit would not work, so I have a simpler question.
Given a git/svn/whatever repository checkout, why can't I simply tell to Eclipse create a project there without touching the files?
Is it so hard for Eclipse to create it's .project in that position?
And since there is clearly no "supported" way to do it, is there maybe any workaround?

From my experience, the stages are the following (using Indigo version):
1. Create new empty project
2. Click File->import->file system
3. in the import window import file system, check the files you want into the new project folder
4. Click on advanced in the import window and tick "create links in workspace"
The new project should contain links to the original directory.

Eclipse modifies and compiles source in its workspace. The first level of the workspace is the project directories, + a .metadata which is local only to that workspace instance. Traditionally, the workspace contains the projects it works on.
Eclipse also supports 2 linked modes. In one, when you create the project in the workspace you give it an absolute path to somewhere else on the file system. This is handy if you have eclipse projects in a git repo, for example.
In the other mode, you create the project in your workspace locally. Then you link your folders (source, resources, whatever) to somewhere else on the filesystem. This is useful for projects that don't want to save the eclipse specific files (.project, .classpath, etc) in their SCM.
You have to create a different workspace on each OS (there's no way around that). But you could create the projects in each workspace and link to the common location (I don't recommend it, but it would be do-able).

Same problem here and finally got a solution!
1) clone your repo but not directly to your workspace, in my case I used workspace2 instead of workspace.
2) On eclipse, import all the projects on workspace2, but don't mark the "copy files to workspace", so the source code is left on workspace2.
3) On git you will see changes appeared, on project.options files (only file date is changed) and in .path files (some lines changed its order). As all of them are irrelevant changes, reset the local branch discarding those changes.
Thats all, git sees no more changes and eclipse open the files properly!
I ran into a weird problem worth commenting here: after importing i went to "git gui" to see changes, and the first file changed was a "project.options" file that only changed its date but the diff was empty (as the content was unchanged). There is a bug on git that makes git gui enter on an infinite loop: while it detect changes on file and diff is empty, a rescan is performed, then the same change is detected and enter on a rescan loop.
There is a patch to solve this, but it was easier just to add a silly comment on that only file (not in all your project.options) and then "git gui" was happy again and i could reset the changes on the branch.

Related

How to change SVN source control repository - Visual Studio 2013

This is a very simple question - How can I remove Source Control from my solution and projects in order to change the SVN repository ?
I have an old project linked to an old repository, trying to move to a new one, and unable to figure out how.
The Actual place in Visual Studio that suppose to enable this is Grayed out.
Removing the .svn files form the folder doesn't apply as they are not there....
using the latest version of ankhSVN.
In your Visual2013. Go--> Tool----> Optioins--->sourcesControl
And Cuurent Sources Plug in None.
just set This. if not retuen feedback...
You seem to want to change the SVN respository that you're pointing to. There is another Question And Answer, but it seems pretty ugly.
Having installed the latest version of ankhSVN on Visual Studio 2013, it seems pretty trivial to relocate to a different SVN respository.
Right click on the Solution -> Subversion -> Switch Solution
On the menu, you should have an entry pointing to the current location of the solution. If the repository is the same, but under a different URL e.g. changing hostname, directory, etc, then simply change the relevant pieces in the URL and hit enter.
It will prompt you that the root you've specified is different from the one that you're currently using and you can simply relocate it from one to the other - i.e. choose to relocate. It will then prompt you a second time to switch, but this should be a free change.
If the new repository is different to the old one i.e. it's somewhere completely different in a different repository with a different repository ID then you're going to have to do some form of manual changing by following the instructions on the other answer.
If you want to remove the svn metadata for the project, it's in a single directory called .svn at the root of the solution that was checked out from subversion, as well as removing the information in the .sln file that mentions AnkhSVN (it's probably the only entries mentioned in a specific GlobalSection in the file mentioning source control). That purges all the svn data from the solution.

Eclipse - bin Folder keeps creating itself

This is a long one, but please, bear with me. I really need help here.
I use Eclipse (latest version) to play with some programs of my own. During installation (?), it asked me where I'd like to put in my Workspace folder. I set it to default, but, not wanting to dig through Documents and such (I have my own Documents folder on another drive), I made sure that every project I have is condensed into one "Projects" folder, not in the Workspace. My "Projects" folder contains every program I've coded so far, from C# to Java, as well as the necessary tools, like the Eclipse folder.
It worked fine for me, until I decided I want to do another project. So, I navigated to my "Projects" folder, and then created it there.
Now for some reason, Eclipse treated the directory I navigated to as my project folder. As in, new folders like bin, src, etc. started popping up in my otherwise organized folder. Visual Studio does not have this problem, and actually creates a new folder for your project under whatever directory you set it to.
So I, in a 'Monday blues' move, went into Eclipse and deleted my project. Eclipse wasted no time in deleting my entire "Projects" folder and everything in it - including itself, apparently. Gah.
I quickly closed Eclipse, but it kept saying something about 'Saving Workspace' which I assumed meant "Don't close me yet, I'm still deleting your files."
I thought I was being sensible when I terminated it via the Task Manager. It stopped deleting my stuff, but out of the dozen or so programs, I only managed to save three.
Wanting to start over again, I deleted (what's left of) my Eclipse, so I can 'install' it again, and let it have its way of where to create projects and save my files, so that this doesn't happen again. Unfortunately, one folder keeps returning no matter how many times I delete it. The aforementioned bin folder, a name that needs at least two adjectives and the suffix "Of the Damned."
So, to summarize:
I lost majority of my programs.
I lost my Eclipse.
And folder 'Bin' keeps popping up.
And so I'd like to ask:
Can I recover my files?
How can I setup Eclipse so that it creates a new project folder when I create a new project instead of treating the directory as the project folder?
How can I permanently get rid of that haunted Bin folder?
If anyone an help out here, thank you so much. This has easily been one of my worst Mondays.
As of now, I have tried:
Restarting my PC (didn't work, Bin Folder is still there)
Downloading and running a new copy of Eclipse (didn't work either)
I have struggles also on my Eclipse for the past few weeks. I answer each of your question below, hope that helps.
Can I recover my files? - If your programs are not physically removed from disk, you can add it back when you have your Eclipse running
How can I setup Eclipse so that it creates a new project folder when I create a new project instead of treating the directory as the project folder? - Create your project by clicking File->New->Android Application Project (if android). Then input the application name,etc. Click Next and uncheck create project in workspace, from there you can have your own location or directory of your project.
How can I permanently get rid of that haunted Bin folder? - In may case, I downloaded a fresh copy of Eclipse. I used the adt bundle which can be downloaded here: http://developer.android.com/sdk/index.html
the sad news is, that Eclipse does not just delete the projects into the bin, like it would happen with the "delete" by clicking on the folder and manually deleting it. You could try with recovery software, but it is not an assurance it will work, or recover all your lost data.
For the more of it, in the Bin folder that is made automatically in any Java project, you get compiled classes which are what gets packaged/archived into any jars that are created.(I hope this makes sense, I couldn't find a better way to explain myself.)
For the set-up of Eclipse I would have a look at the page of Eclipse, maybe a forum, or a FAQ is there.
I for instance use Netbeans, which does from the start always create a new folder for the new projects.
I hope I could somehow help!Here a little link to a recovery software that has a good reputation: http://www.piriform.com/recuva
Kind regards,
DomExtra edit: Version Control is an awesome tool to save your buttex from trouble like this ;)

Delete an unreferenced image from repository in Xcode

I deleted default.png from my resources folder because I wanted a different image for the loading screen, but I just deleted the reference which was apparently a dumb thing to do. I dragged the new image into resources and tried to change the name to Default.png, but it won't let me, which I think is because the first Default.png is still in the repository somewhere. Anyway, how do I delete that image(and others with which I have probably done the same thing) from the repository when it is no longer visible in xcode?
What kind of repository is it? Subversion? Git?
The SCM integration in Xcode is great for checking out files and committing changes without having to leave the IDE, but it's hardly a full-blown GUI front end to either svn or git. It may be possible to fix your mistake by adding the file back to the project and then deleting it in Xcode in such a way that Xcode will remove it from the repository for you, but the simple solution is to just delete the file from the repository yourself by using the appropriate version control command. For example, if you're using Subversion you could:
svn remove default.png
to remove the file from your version of the repository. When you commit your changes, the file will be deleted in that version. (It'll still exist in previous versions -- that's the whole point of SCM, after all.)
After that, you can create the new file and add it to both the project and the repository in the usual way.
You need to manually go into your app's file structure and delete the image files themselves. Also, it is usually a good idea to "clean" the app whenever you remove files or references to files from an XCode project, since XCode can be a bit temperamental about removing files; the key combination for this is
Hope this fixes your problem.
Clean all targets should work (at least it worked for me). You can try the following:
a) delete the reference from "Copy Bundle resources" of your target
b) delete the app from Simulator/Device
c) clean all targets
Caleb is absolutely right. That fixed the problem here as well for the most files.
An easier way to get an overview of the accidentally un-deleted files, is creating a bookmark of the working copy with Versions (SVN Software - in case you use SVN). There you can detect the problematic files grafically and delete them. I always have to do this after restructuring the project folder.

Remove project from SCM in Xcode

I have an iphone project on a mac. I set up an SCM repository and then ignored it for a while. Now I've decided to back up my source to my main PC and do source control there. I'm finding that the SCM wants to roll back my changes seemingly at random.
How can I kill SCM in Xcode on the mac? I need to tell it to leave my source files alone. Nothing is worse than making changes and having your changes replaced.
I work alone, but have about 10 projects in source control on the pc.
Thanks,
Gerry
if you want to remove svn from folder manually
check the .svn folder is deleted from your project
its in very directory and sub directory
Assuming your using Xcode: As long as you have all your files (and another back up) you can go to preferences, scm, and then just remove the repository.

SVN: Colleague checked in a folder into repository, but I can't Update my version to it

In showing a colleague how to use SVN yesterday, we created a test folder and file within our existing Visual Studio Solution. We'll call it "Test" folder with two files, "Test.ascx" and "Test.ascx.cs". We added it (or Visual SVN added it, 'cos it's awesome), and committed it. We also added and committed other files elsewhere in the project.
We can see it in the repository (and the other files).
Doing an update on my own machine to pull down these new files resulted in the other files being pulled down correctly, BUT the Test folder does not appear. No matter how many times I try Updating from various points in VS and in TortoiseSVN (urgh) Repo browser, it can't see that there are any changes to pull down.
Where am I going wrong?
This is a known problem.
You can use
$ svn update --depth=infinity
to force the update. With TortoiseSVN, use the "Update to revision" command in the Submenu, then change the depth combobox to "fully recursive".
I've had ghost errors like this before and found the easiest work around is to delete the parent folder and update it's parent:
Project Root
Project
NewFolder
Delete Project, then Update Project Root
We can see it in the repository (and the other files).
...
No matter how many times I try Updating from various points in VS and in TortoiseSVN (urgh) Repo browser, it can't see that there are any changes to pull down.
So you can or cannot see it in the repository browser?
Did you commit and update the parent folder of your Test folder?
I don't know, svn is always telling me to clean, did you try that?
It's not an answer, I know, but I have tried all the solutions you guys have kindly suggested and I just end up with conflicts, crashed TortoiseSVN and built up Karma. Therefore, a trusty edit in the .svn/entries file sorted it.
I have until now been a single developer using SVN just to manage my source code. Other people don't have problems, and I just check in stuff. I use Visual SVN as a layer to frig SVN for .NET (which it isn't great with) and I seem to constantly run into issues. I am performing very simple operations, not even branching/tagging. Simple simple simple. And yet I have issues with it?

Resources