Versioning for solo projects - version-control

I have been searching both google and other SO questions but none really describe my situation.
I often create a copy of a project when I have a major feature working, so that I don't destroy it when I keep coding. Currently I am just copying the project in eclipse and renaming it to something like "MyProject2.0". This leaves my workspace VERY cluttered though.
Those are not huge upgrades, for normal versioning this is x.0.z, x.1.z, x.2.z at best. Should I just use Git or something similar? I am looking for a way to keep the old code(easily at hand) but also not clutter up my workspace like this.

Yes, you definitely should. Use Subversion, Git, Mercurial, CVS ... whatever you feel fine working with. Even for solo projects version control software is a huge help in my experience.

Any version control system will help. I've used rcs, cvs, svn and git along the way, any of them will do the trick for you. Choosing a revision control system, especially if you are a soloist is personal choice. You may want to consider git, as it is quite a good tool for what you are describing. GIT is well described on the git site with practical examples. Using it will surely get rid of your clutter. You should specifically read up on the git workflow that describes how to work with branches in a git controlled project. Also look at "stashing" in git, you'll see what I mean about git being nice for solo projects.

Related

Struggling with managing my eclipse workspace and what to do about syncing it between two machines

I'm trying to sync my workspace with PC<---->Laptop. PC is windows, the laptop is ubuntu Linux. Both have 5.1 Mars eclipse version.
So far I've been using dropbox to sync in between but problems started occurring but managed to solve them. I was compiling classes with a newer version of java and the other eclipse didn't know what to do. Syncing with dropbox is really not an elegant way of doing this.
So now I'm trying out git, but so far I've been confused by it and how it works. I have managed to set the git plugin in the eclipse but not sure what to do next. The plugin is called EGit.
As far as I understand so far, it works like this? workspace--->local repo---->git repo? Then I would have to manually sync the code back on my laptop by entering the commands in terminal?
I already did push some stuff to my private repository, but that was on my laptop.
Is it possible to setup an easy way to sync the code? I know git is a good versioning system and a good way to keep the code updated? I'm a first year CS student and so far I don't have any complicated or large projects to manage with. I'm just looking for a nice way to sync the code. I guess having git setup is an ok way to go about it, but I'm overwhelmed by the features of git and not really grasping it.
Thanks for reading.
It would be a good idea to learn how to do it right. It's a better investment of your time than working on workarounds which only work in a certain situation or which are of limited use. Yes, you could use git for that. You do not really need the EGit plugin, just use the git command line, in my opinion that is easier. There are a bunch of great git tutorials out there. For the beginning the basic commands like git init, clone, pull, status, diff, add, commit, push are sufficient. You would need a central git repository, get a free GitHub account for that purpose.
Compiled classes should not be commited into your source repository. Add folders with any generated files to your .gitignore file.

Is there a plugin for Eclipse that allows two people to edit the same project at the same time?

A friend and I want to work on the same project. Is there a way that we can work on the same project at the same time and have the files stored on Google Drive or Dropbox?
You really want to use a version control system, like mercurial or git. There are lots of hosting options for both of these, like github, bitbucket and others.
Edit: As was observed in a comment, you may also take a look at Subversion or CVS. Whichever works best in your case.
As for Eclipse integration, there are solutions for most systems :
http://javaforge.com/project/HGE for Mercurial
http://www.eclipse.org/egit/ for Git
http://www.eclipse.org/subversive/ for SVN
You can Setup a remote git Server or use bitbucket
In Addition with egit for eclipse :)
I Have done this yesterday and it works pretty well
//again too slow :P

Version Control for School Project

we will be doing a project for our Object Oriented Software Eng. class, and our team consists 4 people, including myself. Our groups were made random, so I do not know their level of skills. Maybe they have never heard of version control. I am looking for a system that will allow us to work together. I have used SVN and Git for a very little time. However, I am not very confident with them. Can you suggest a nice and easy to use system that is compatible with Eclipse or NetBeans IDE? Simplicity is the most important thing and I do not know how to use Git or SVN for a project more than one people. (I have only used them individually)
You need to have some kind of Source control.
If you have used SVN/GIT in your own projects using it in a team is just as easy. SVN is easiest, however even though it is a little harder I would go for mercurial with tortoiseHG, hosted for free at bitbucket.
It will Integrate into the windows UI
Its distributed which will make things smoother and reduce merge issues
You get free private hosting
You can use tortoise SVN or VSS (Visual source safe) to maintain project among multiple peoples. In both tool, you can maintain local copy of project in your PC and commit your changes on server when it completes.
Version control tools comparision : http://en.wikipedia.org/wiki/Comparison_of_revision_control_software
Have a look at Mercurial. It is easy to use and portable (it's written in Python). If you use Windows, you will probably find TortoiseHG useful too, as it provides Explorer extensions for mostly all functions Mercurial supports. There are also many sites that provide free project hosting for this VCS, such as BitBucket. And here is a nice tutorial about Mercurial.
EDIT: I once found a Mercurial plug-in for Eclipse. You can find it by searching in Help > Install Software in Eclipse.
I have used Dropbox as source control in a project once, it worked ok you can also revert to old version of your files which is great, we didn`t have to work in the same files so there was no conflict.
But now that I have gotten used to svn and mercurial I would never use something else. I too would recommend using mercurial with tortoiseHg and a bitbucket acount. I have started using it for smaller project as well, I simply did a repository with all of them in it so I have at least a backup and I am able to revert to an old version if need be.
My recommandation is to avoid sharing a folder using tools like dropbox and use a real source control like mercurial hosted on bitbucket (free for project with less than 4 users).
I'd say using SVN or GIT is a bit over kill for a school project which is likely to not last that long.
Another option would be to use something like DropBox.

Which SCM and Issue tracker for personal work?

I am planning to bring some "peace" (you may call it organization) to the personal work (small projects, etc.) I do at home.
I would like to use a SCM and an issue tracker which can capture the commits and show them as changesets etc. automatically.
Note that all the above applications are supposed to be for personal usage so would prefer something from FOSS and also they need to be ultra lightweight in terms of the system requirements.
What do you recommend?
EDIT: Following are some of my doubts/concerns:
Git with GitHub looks good. But I am not very comfortable with making my code base public on GitHub. What do you say?
Does GitHub provide an issue tracker? I mean, can I open up an issue on GitHub provided issue tracker and commit against that issue?
Can I have a local SCM (on my laptop) and use some remote issue tracker like FogBugz? But I just don't understand how could a remote issue tracker capture my commits. Any idea?
UPDATE:
I finally went with Mercurial and BitBucket. Working awesome so far!
I would recommend Git with GitHub
I like and use Redmine with the basecamp theme. It supports a couple of version control systems like git, mercurial, svn, ...
For projects that I want to publish I use bitbucket.org and github.com.
I never tried, but would look into git in combination with ticgit ..
If you're going free personal, I'd recommend SVN and Trac. The two integrate very well together with a little bit of configuration. They're also both pretty lightweight.
If you're willing to spend a bit or are working on an open source project, I'd recommend Atlassian's tools Jira and FishEye. I've worked with them as well and have found integration to be very good. They can be a bit hefty though, and I've found the FishEye client to be very AJAX heavy to the point of performance issues.
If you can trust that you'll always be working on your personal projects near your source control server (or if you're doing it all on the same box) then I'd suggest Subversion. I feel the barrier for entry is lower for it than distributed tools like git or mercurial.
I'd look into VisualSVN for your server.
If you're running it all on one box, you can use TortoiseSVN's built-in Repo feature.
My favorite clients are TortoiseSVN and AnkhSVN (if you need VS integration.)
For an issue tracker, a simple story board might be better than a piece of software.
I use org-mode in emacs to track personal projects.
I've used various SCMs for personal work. For really small stuff I still sometimes just run ci -l somefile to start versioning with RCS, because I'm old-school that way. I've happily used Darcs for personal stuff, and I maintain that Darcs is still the easiest to use DVCS out there. These days if I think I'm going to be Open-Sourcing the project I'm likely to use Git, just because that makes putting it on GitHub straightforward.
I also like to use personal projects as an opportunity to experiment with other SCMs that I'm not familiar with, so I'll probably be versioning projects with Bazaar and Mercurial in the future.
In the past, I've used CVS for source control, but I've recently started converting most of my personal projects to use git. However, I don't like the way git works with Visual Studio, so I've been switching to Subversion for my C# projects.
For issue tracking, I've been using Redmine which supports all three SCM methods, though it does better with SVN and git.
Lightweight issue tracking, well, you could use the tracker in drupal, if you consider LAMP easy enough to set up.
If you want to be self-contained, git and mercurial are things you can use without setting up a server at all.
Of course, there's good-old-RCS.
I would have to second using the Subversion and Trac combination. I have this environment setup at work and use it for a distributed team of developers, and I have this environment setup at home and use it for my personal projects. They are open source, very adaptable to your workflow and Trac Hacks has pretty much any mod / hack / plugin you could think of in one form or another.
For very personal things (let's say single-user-mode) I use Tomboy (a simple note-taking application) and Getting Things Gnome. If the project becomes more complex, then I used to switch to Trac with svn or hg backend. For next projects, I'm going to try redmine: seems more clean and hipe than trac (:))

Introduction to Mercurial

I have just begun working on a project which uses Mercurial as a version control system, and I need some basic tips on how to use this. Please use this question to give some introductory tips on this technology.
The official Mercurial site
Especially, I am looking for tips on the best programs to use and the best techniques to use (branches, in and out-checking etc. I need to learn the best-practices!)
I know you already have the Mercurial site but the resource most useful to me was the Mercurial book. It's an excellent overview of the program and how to use it.
I found the best way to learn Mercurial was just to use it on a project. I imported into Mercurial a project I had exported from subversion and did some regular development with it. I made sure to clone the repository for different changesets so that I could get used to the merging and updating. I haven't learned all of the advanced uses but I'm now on a pretty firm footing with it and haven't switched back to Subversion yet.
A lot of projects have different techniques for commit workflow. Some have changes pushed from the developers, like centralized systems, and some will pull the changes from contributors (Linux, for example). It's hard to generalize too much without knowing the process for your project.
This is how I do my development:
Centralized tree on a file share or http, called project-trunk or project that is the definitive project version
A clean tree on my system that I clone from the remote repository and use to push back to the repository. I then clone from this tree for my changes. I call this tree project-local
Clone the project-local tree for each of my changes: eg. project-addusers, project-141, etc.
After I am finished with the commits to a tree, I then push the changes to the project-local repository
Finally, push the changes in the project-local to project-trunk
I have the clean project-local tree because then I can push all the changesets back to the trunk at one time, which is helpful if there is a group of related changes that need to push back together.
As for tools, it depends on your platform. I just use the vanilla command line tool. Coming from TortoiseSVN, it was a bit of a change to go to the command line. But I'm fine with it now. I tried using TortoiseHg but it didn't function well on my Windows 7 x64 virtual machine. I hear it's much better on the supported 32-bit platforms.
Here is a helpful tutorial on Mercurial written by Joel Spolsky.
It covers basic usage and commands, as well as how to work with Mercurial at a more conceptual level. If you are already familiar with SVN, then the first part is definitely worth reading: it talks about the major conceptual differences between SVN and Mercurial, because trying to use Mercurial in the same way that you use SVN is asking for trouble.
Have a look at the Mercurial book, or at this Mercurial tutorial.
Depending on your background with other source control tools, I would also suggest a specific SCM-whatever to Mercurial guide. For example, have a look at this guide for Subversion users.
Another good resource for getting your head around the whole "distributed" source control idea is: http://betterexplained.com/articles/intro-to-distributed-version-control-illustrated/ ... with helpful diagrams!
If you use the latest TortoiseHG client and include the install directory in your PATH environment, you will be able to use both the nice GUI they provide, and the command line 'hg'
I cannot recommend using the mq extensions too much. They make for a great 'working repository' environment.
I use the queues to manage local changes against a subversion repository. I do my local short term changes and use mercurial to keep in sync with subversion and the rest of the team.
A few of Steve Losh's blog posts are good, even though they're a couple of year old now. They mainly deal with how to work with branching.
Guide to Branching in Mercurial
Branch Workflows - Branching as needed
Branch Workflows - Stable and Default
It's also worth looking at his hgtip.com site.
In addition to the Mercurial Book and the Hg Init tutorial, I'll like to mention the example-driven guide I've written:
Mercurial Kick Start
It shows how to get started with Mercurial and also covers some more advanced concepts such as named branches and hgsubversion. I've used it when teaching Mercurial to new users and they seemed to like it.