Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 5 down vote accepted

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.
share|improve this answer
    
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. –  acidzombie24 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. –  acidzombie24 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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.