How do I add programmatically-generated new files to source control?

Posted by Alex Basson on Stack Overflow See other posts from Stack Overflow or by Alex Basson
Published on 2010-03-01T16:25:44Z Indexed on 2010/04/02 3:03 UTC
Read the original article Hit count: 354

Filed under:
|

This is something I've never really understood about source control, specifically Subversion (the only source control I've ever used, which isn't saying much). I'm considering moving to git or Mercurial, so if that affects the answer to my question, please indicate as such.

Ok. As I understand it, every time I create a new file, I have to tell SVN about it, so that it knows to add it to the repository and place it under control. Something like:

svn add newfile

That's fine if I'm the one creating the file: I know I created it, I know its name, I know where it lives, so it's easy to tell SVN about it.

But now suppose I'm using a framework of some kind, like Rails, Django, Symfony, etc., and suppose I've already done the initial commit. All of these frameworks create new files programmatically, often many at once, in different directories, etc. etc. How do I tell the source control about these new files? Do I have to hunt each one of them down individually and add them? Is there an easier way? (Or am I possibly misunderstanding something fundamental about source control?)

© Stack Overflow or respective owner

Related posts about version-control

Related posts about frameworks