English 中文(简体)
How can a mobile student effectively use Dropbox with a source control system?
原标题:

I got a laptop in preparation for the coming semester, which will see me taking a university programming course while working full time. I will, of course, be using a source control system (probably Subversion) and had the idea of creating my repositories in my Dropbox folder, which would enable me to check out and work on code locally using my laptop or my desktop (or, indeed, any other computer that can access the Internet), and then commit it back to the shared Dropbox repository.

  • Any pitfalls or reasons why this is not a good way to accomplish my goal? (Let s assume that I can avoid corrupting the SVN repository by doing something stupid.)
  • Any clear advantages to going with a web hosting solution that would outweigh the advantages of Dropbox (viz. it s free and already set up on my machines)?
  • Any other strategies to share for working on code from multiple locations?

Note: I do not intend to share the Dropbox folder with others, as I realize that multiple people accessing a repository via file:// is a bad idea. My question only pertains to an individual user.

最佳回答

While at first glance this seems like a bad idea (basically layering two different revision control systems on top of each other with different workflows), there is a way that would make sense for you assuming you are the sole developer.

(As a side note, what Dropbox gives you is offline backup of your data as well as a server from which to sync with. If you attempt to use SVN on its own, you will have to configure your machine to allow access remotely. This may or may not be a deal-breaker for you depending upon your level of expertise in sysadmin type tasks.)

What you could do is create a repository for a given project in your Dropbox drive. Then when checking out a working copy, create it outside of the Dropbox folder, accessing your repo using the file: protocol. This way the repository stays synced across all machines, but each machine has a separate working folder, allowing you to work on a different branch on one machine than another if you wish, or maintaining uncommitted code without it getting propagated to another machine. Where this breaks down is if multiple people are accessing the repo via the file: protocol - this is not recommended due to possible race conditions.

Note: this solution allows you to continue to commit even when offline, like other DVCS would. But note, doing this and then committing offline on another machine before allowing the repos to sync could be disastrous! It is extremely important to allow the repos to sync after working offline before doing a commit on another machine.

问题回答

I would suggest using a DVCS rather than Subversion with Dropbox. The reason is that it is possible to produce a merge conflict with Dropbox by changing the same file from to machines at the same time with limited / no network connectivity. If you manage to mess up your subversion repository like this, it will be difficult to fix the repository, whereas with the popoular DVCS systems you can at least nuke the broken repo and clone a local version of it back to the Dropbox share.

I realised while writing the above, that you do not mention whether you are using more than one computer with the same Dropbox account, so the above does not really apply if you re using your Dropbox account with only one computer (I guess it might if you do something really silly / weird).

I would use Git and Github. Then you have a source control AND you can easily access it from both places.

Or even more ideal would be to setup your own server to host the svn or git repo, but that s obviously not always an option.





相关问题
Tracking Versions, Builds, Revisions, with TortiseSVN

I am the sole developer on a project and have been using tortoiseSVN for quite a while. Now Id like to start getting version information working correctly in the project I.E. show Major Version, Minor ...

Tips on upgrading CVS to git/hg?

We still use CVS, I use git and hg for my personal use though I m still a novice at both, but I realize they re much more modern and better, faster, distributed, etc. It s just everyone is so ...

How to handle different csproj [closed]

I am working in a team of five. We are working on a C# application with five csprojects. The problem is that for each csproject, each of my colleagues has their own ideas on how to reference a DLL; ...

Changing username in SVN+SSH URI on the fly in working copy

I am using SVN+SSH to check out a working copy of repository from an SVN server on which all developers are members of a developer group and have full read/write permissions on the repository ...

How to search for file in subversion server?

Is there a way to search for a file in a subversion repository? Something similar to Unix find command, with which I can find the location of a file in a repository. I know there is svn list, but ...

热门标签