3

I'm trying to setup a version control for my one man project. My project files are in sync thanks to live mesh (but I could be using dropbox for that matter), between my laptop, my home pc and my office pc. I'm now using Netbeans with local file history. Sometimes it helps to revert to a previous state of one file. But imagine a situation when multiple files have problems. Correct me if I'm wrong but I would have to go to every file and revert to previous "safe" state. I don't like this approach, so I'm considering using a version control between SVN and GIT.

I have some previous experience with SVN (TortoiseSVN) and I know that I can create a file:// repo.

So, what a want to do is setup a VCS inside my synced folder just to have the ability to "revert" to a previous version if something goes wrong. Since everything's been synced to all computers, I wouldn't ever need to run an update.

The file tree organization would be the following:

C:...\SyncedFolder\MyProject\

Inside MyProject folder are all the project files plus a directory that has SVN or GIT info of my project (the repo/master).

What VCS is best for this situation: SVN or GIT? Does SVN need to store all files from HEAD revision, thus "duplicating" all my project inside my synced folder? Does GIT eliminates this problem? Is this the best approach?

StackUnder
  • 141
  • 3
  • My situation is somehow related to this question (http://stackoverflow.com/q/3007352/1252879) but this is for GIT only. I'd like to know how GIT and SVN performs in this scenario – StackUnder Oct 10 '12 at 22:17

2 Answers2

2

What VCS is best for this situation: SVN or GIT?

Does not matter at all. If you sync directory tree between nodes you'll have

  • 3 working copy
  • 3 repositories

in both cases.

Pure DVCS solution may be smaller in terms of total size, because it doesn't store WC-metadata in .svn folder(s) inside working copy, but - GIT handle binary data extremely worse, than Subversion (or Mercurial)

Lazy Badger
  • 1,935
  • 12
  • 16
  • I just finished my test using TortoiseGIT and TortoiseSVN in two identical folders inside my synced folder. Original folder has 3.928.359 bytes and 422 files. SVN folder has 9.431.303 bytes and 761 files. GIT folder has 5.322.313 bytes and 828 files. So indeed the DVCS solution is smaller. Another disavantage against SVN is that I had to create a folder inside the project folder to act as the repo and added to ignore list. With GIT I just had "Create Repository Here" and then just use Commit->master to allow Diff to work. – StackUnder Oct 11 '12 at 00:07
  • I was about to jump on the Git bandwagon but the binary data handling problem got me thinking. It's a PHP project, so it has some binary files (images, .docx templates). Is this gonna be any trouble for GIT? – StackUnder Oct 11 '12 at 00:11
  • 1
    @StackUnder - your experiment around SVN|GIT *may be* not clean in *some* aspects: better (more precise) results may be obtained on testing repo with **significantly large** history. For SVN-repo location you are not tied to "repo below" WC, even more - for manageability you have to have repo and WC on the same level in tree: both in SyncedFolder – Lazy Badger Oct 11 '12 at 03:05
  • 1
    @StackUnder Read this .... http://programmers.stackexchange.com/questions/80962/should-images-be-stored-in-a-git-repository/80966#80966 – mattnz Oct 11 '12 at 03:18
  • 1
    @StackUnder - and [this answer](http://stackoverflow.com/a/5772057) on related question also about Git&binaries – Lazy Badger Oct 11 '12 at 04:36
  • @mattnz and LazyBadger - Thx for the info. I decided to use GIT with Netbeans plugin and since all my work synced I added to ignore list the binary files, since I'll not Diff them. – StackUnder Oct 11 '12 at 13:35
1

I use GIT, Git Extensions http://code.google.com/p/gitextensions/ (which installs git on windows) with free private repo from https://bitbucket.org/ . I use bitbucket to transfer source code between my workstations and also keep my code offsite (for backup purposes). Just need to make sure you push the latest changes when you are done so you can pull them when you get to the new workstation.

Since with GIT, each user has the full repo on their machines, I'm not too worried about bitbucket losing my data. Just to be safe, I also sync my repos to google drive.

probably better ways to do this but it's working so far for me

gnat
  • 21,442
  • 29
  • 112
  • 288
Northstrider
  • 121
  • 4
  • Sorry if I didn't make myself clear but I don't want to use cloud repos. I'd like to store my repo inside my synced folder. I want to use the VCS only to perform revert operations, not push/pull – StackUnder Oct 10 '12 at 20:22
  • You can put your git repo in dropbox or google drive, etc. You still need to "commit" your work so you can revert operations – Northstrider Oct 10 '12 at 21:16
  • I can do this too using SVN, but is GIT better than SVN for this scenario? Does GIT duplicates the files from the MyProject folder into the .git folder or does something else? You see, I know they both can do this but at what cost? I would like a comparison. – StackUnder Oct 10 '12 at 21:29
  • @StackUnder: GIT does not need a central server as SVN does, so is much better suited. Cost? What do you mean - GIT is Free. Disk space is cheap. Your sync problem is best solved with Bitbucket. as it makes syncing the changes easier as the various PC's don't need to connect to each other. You could also carry a GIT clone or just bundles around on a memory stick if you really object to BitBucket for sync. – mattnz Oct 10 '12 at 21:41
  • @mattnz I meant cost about how much storage does it uses against SVN files. Maybe my question isn't clear but I dont have a sync problem. The sync is fine. I just want to add the ability to revert files (and maybe have a history of the development). So, if I peform a GIT clone using my previous described file tree organization I would have the git master repo and the git clone inside the synced folder. Is this the only way? Can't I somehow working inside the master repo without cloning it? Does SVN do something like it? – StackUnder Oct 10 '12 at 21:52
  • 1
    it'd help you to play around with it on your local pc. Most people use the command line to initialize a repo. I've gotten lazy and used GUI tools like git extensions. Basically you can create a new repository of a directory and all its files. or you can create a "bare" repository, which will be used to receive files pushed to it. or you can clone an existing repository onto your machine. (which means you now have that full repo on your machine with all it's version history). – Northstrider Oct 10 '12 at 22:40
  • I just did this and came back to report my findings. Ill comment below since Lazy Badget answers seems right – StackUnder Oct 11 '12 at 00:00