Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

One repository/multiple projects without getting mixed up?

After reading Joel's last article on Mercurial, I'm giving it a shot on XP as a single-user, single-computer source control system.

One thing I'd like to check, though, is: It'd be easier to just create a repository of all the tiny projects I keep in eg. C:\VB.Net\, but the result is that the changes I make to the different projects therein (C:\VB.Net\ProjectA\, C:\VB.Net\ProjectB\, etc.) will be mixed in a single changelog.

But if I use a single repository for all projects, when I do diff's or go through the change history, will I be able to filter data so that I only see changes pertaining to a given project? Otherwise, is creating repositories in each project directory the only solution?

Thank you.

like image 264
Gulbahar Avatar asked Mar 19 '10 07:03

Gulbahar


2 Answers

I'd keep one repository for each single project. The overhead is minimal (just one hg init for each source code directory, or one right-click in Explorer), and you won't get confused. After all, why should a change to one program affect the version history of a completely unrelated one?

Of course, you can see the history of each file in the Repository Explorer, but I think it goes against the very concept of version control to mix unrelated stuff into one repository.

like image 119
Tim Pietzcker Avatar answered Nov 09 '22 15:11

Tim Pietzcker


The right granularity for a DVCS (i.e. a repo where all the history can be cloned) is the project.

If you have several projects which have different development lifecycle (i.e. a change in one does not always affect the other), they should be in their own repo.

like image 40
VonC Avatar answered Nov 09 '22 15:11

VonC