3

I have /src/main/ with all my code (i also have /src/online, /src/prvlibs, /src/test, etc) but now i am thinking about moving a few non active projects out of the folder. Sure i could go in and delete all objs, (some) project files, etc so it doesnt take 200mb of generated data. But i think it might be nice for only 20projects or less instead of dozen of prototypes that aren't throwaway test.

I use git for source control (but i'm sure all scm do the same thing). They dislike files are missing and if i delete them they aren't easy to browse. I like how i can commit all of my source by going to /src/main and commiting. And i can push all of them just as easily. But moving folders (to my external HD and keep history) is the problem.

Should i have every folder have its own repo? or is there some kind of workaround i can use? If every folder has its own repo is there an easy way to push all my folders to my HD (or website) for backup?

Macneil
  • 8,223
  • 4
  • 34
  • 68

1 Answers1

4

You should not keep all your projects (not even the experiments) under the same version control repository. Yes, you should have one repository for each project.

As to the pushing, write down a small process that you follow when you work on a project, include a push in it, and make provisions for backup.

Private repositories in public GIT sites (like GitHub) are an easy way to backup to the cloud using a simple process.

I'm paranoid about version control because I had really bad things happen when I wasn't. My process for an ongoing project is:

  1. Commit frequently.
  2. Push to central repository when a feature is complete or before taking a break.
  3. Backup working directory after a session.
  4. Backup central repository.
  5. Pull in working directories under other OSs or other workstations, test, fix, and repeat the above.
  6. Push to bitbucket.
Apalala
  • 2,283
  • 13
  • 19
  • I agree. I'd also add that you don't want generated files anywhere near a "src" directory. Generated files should go in a "bin" directory. – Macneil Apr 15 '11 at 18:40
  • Do you have any suggestions for pushing all repos when i attach a drive? I am thinking of writing a script that will look at every folder and do a push. @Macneil: Unfortunately when using asp.net you cant avoid it. git easily ignores generate files tho. I ignore /Debug /Release which handles 90% of objs then /resource and a few *.ext for generated files (either profiling or intellisense) and its handled. –  Apr 15 '11 at 19:20
  • @acidzombie24: This sounds more like a backup management plan than a version controlling plan. A better fit for you might be Dropbox. – Macneil Apr 15 '11 at 22:27
  • @Macneil: What! are you crazy.... It's insane to think dropbox is a suitable SCM. –  Apr 15 '11 at 22:46
  • @acidzombie24 Attaching a drive is about backups. A script is OK, but the least often talked secret about backups is that they must be tested by a restore, or deemed useless. – Apalala Apr 15 '11 at 23:43
  • @Macneil: As a matter of fact, I do have Dropbox in the mix, to backup my central repositories. Configuration management is all about being able to go back in time: to be able to restore a project to its state in a particular moment. Backups have a lot to play in that, and, if you think of it, modern SCM is no more than a reasonably sophisticated backup scheme. Think about a small fire in the office kitchen that triggers the sprinklers with who-knows-what consequences on the servers; if you can't be up and running in a couple of days, then your SCM/configuration management **sucks**. – Apalala Apr 15 '11 at 23:48
  • @acidzombie24 You should back up folders and the entire hard disk as frequently as it is reasonable, but configuration management has to be on a per-project basis. Think of someone else being able to take over a years-old project without access to your hard disk. Have you never lost a disk or a partition to bugs, hardware, weather, or human failures? – Apalala Apr 15 '11 at 23:52
  • @acidzombie24: Relax. Read what I said again and realize that's not it. – Macneil Apr 16 '11 at 01:09