tags:

views:

162

answers:

10

new to visual studio and programing in general. I am starting to work on a asp.net project. At home I have a computer running Windows 2008 Server with SQL 2008 and Visual 2008 running.

I want to install the same thing on my laptop win2008/sql2008/vs2008 so I can take it with me on the go.

What I want to know is how would I synchronized the two, where projects would syncrhonized to my laptop and I can take it on the go, then when i return and connect it to my network, it synchronizes back to my main workstation so the two are always the same?

A: 

What about saving your project files directly to a thumb drive?

Either that, or you set up a batch file to copy them files to/from the thumb drive before and after each session. This is more cumbersome, but quite safer otoh.

schonarth
+1  A: 

It sounds like you want to use revision control software.

If that's not the case (you don't want to check-in changes every time you change from one machine to another), you can probably script something with rsync.

KeyserSoze
A: 

Sounds to me like you need a Source Control system. This solution is normally used to synchronize codebases between a team of developers but the paradigm still holds true for a single developer on multiple workstations.

The de-facto open source RCS is Subversion (SVN)

See Also: Wikipedia - Revision Control

Declan Shanaghy
+1  A: 

You need a version control system (VCS) or dedicated file synchronization solution like "unison".

Nowadays, version control systems come in two varieties: distributed or nor. In distributed VCS, each copy of repository (project) is equal and could be worked on without network access, could be used as source for spawning new working copies, etc. Examples: darcs, git, mercurial, bazaar.

Not-distributed (classic) VCS assume that you will set up some kind of version control system and connect to it via network from each of your workplaces. Examples: CVS, SVN, Visual SourceSafe.

I'd stick with the distributed version control system (mercurial?).

ADEpt
A: 

Personally, I'd probably go with a SVN repo somewhere... however, one other option: keep a VM on a portable HDD (USB etc) and treat your entire development OS as portable.

Note that a VM or a thumb drive don't replace version control; it isn't just about ensuring you have a copy of it... Since you state you are new to programming in general, I'll volunteer a recommendation: grab VisualSVN Server and Tortoise SVN (a client); both are free and trivial to get working on Windows - very much "next next ok". Other version control systems are available, but these are simple to use.

Marc Gravell
A: 

Regarding the the VCS suggestions; if you're making going to be building in short iterations and expect the code to not be completely stable at the end of the day when you do a commit, you should make sure you use the branching features in either the central or distributed systems to make sure that you don't pollute the trunk with unnecessary cruft. That way you can frequently commit to your hearts content without disrupting the core. In Subversion this does come with a penalty of losing a clear history, but it will still be there, albeit not with the trunk but in the branch. Some of the distributed systems handle this better. Jeff Atwood had a good article on this.

Erik
A: 

If you're to have the exact same project folder in both sites, you can use Windows "robocopy" command to syncronize changes in one folder to the other.

Make a batch (.bat) file with the command, then you can just double click it to have it synced. The command recognices network paths, so you can use "\\my_workstation\path\to\project" as destination folder. This following command will mirror (/MIR) all files and subfolders (/E) in the source folder into the destination folder.

robocopy "source_folder" "destination_folder" /E /MIR

Besides syncing your folders, it's also a good idea to have a version control system. It allows you to go back to a working state of your code if you mess up. Read the other answers to know more about it. I personally like SVN, since I find it really simple and straighforward (Follow the links on this answer).

Pablo
A: 

I like Microsoft's Team Foundation Server's shelvset feature. I gives one the ability to put the code they are working on into the revision control system without creating a changeset (or in SVN terms, revision). One goes to their other machine and un-shelves the shelvset.

A bigger problem is syncing the database behind the application. This requires that all of the scripts needed to create and update the database need to be part of the project. Also you will need scripts that generate test data.

Rob Murdoch
A: 

Check out www.mesh.com Another new and easy way to sync your files in many devices.

Install Windows Live Mesh and have your project folder be a Mesh folder and it just automatically sync to your added devices. I am doing this for last 1 month and it works very well. I can just continue working all my 3 machines with out having any extra copy/paste Please note that the scope of live mesh is far beyond this feature.

Jobi Joy
A: 

Should you not want to go the way of a source control system (since it will still be hard to sync your DB's and virtual directories) you could always set up a virtual machine and just develop on that. When you move between computers you can copy the virtual hard drive from one computer to the next.

Problems with idea may be:

  • With VS2008, SQL2008 and Win2008 your virtual hard drive will probably be a few gig's big and will take some time to copy between PC's
  • Your environment may also be slightly slower since you are running of a virtual PC, but if you give it enough resources and kill all the processes running in the background you should be fine.

A nice benefit of this solution is that you can now run say Vista on your home PC and XP on your laptop and still develop on a Win2008 environment. (if you wanted to).

FryHard