一个存储库/多个项目不会混淆?
读完 Joel 上一篇关于 Mercurial 的文章后,我尝试将 XP 作为单用户、单计算机源控制系统。
不过,我想检查的一件事是:创建一个我保存的所有小项目的存储库会更容易。 C:\VB.Net\,但结果是我对其中不同项目(C:\VB.Net\ProjectA\、C:\VB.Net\ProjectB\ 等)所做的更改将混合在一个变更日志。
但是,如果我对所有项目使用单个存储库,当我进行比较或查看更改历史记录时,我是否能够过滤数据,以便只看到与给定项目相关的更改?否则,在每个项目目录中创建存储库是唯一的解决方案吗?
谢谢。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我会为每个项目保留一个存储库。开销很小(每个源代码目录只需一次
hg init
,或者在资源管理器中右键单击一次),并且您不会感到困惑。毕竟,为什么对一个程序的更改会影响一个完全不相关的程序的版本历史记录呢?当然,您可以在存储库资源管理器中查看每个文件的历史记录,但我认为将不相关的内容混合到一个存储库中违背了版本控制的概念。
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.
DVCS(即可以克隆所有历史记录的存储库)的正确粒度是项目。
如果您有多个具有不同开发生命周期的项目(即一个项目的更改并不总是影响另一个项目),那么它们应该位于自己的存储库中。
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.
如果有人使用 bitbucket,他们只允许一个私有存储库,因此如果您希望它们是私有的,您可以将所有项目放入其中。我想听听有关此场景的评论。
In case somebody uses bitbucket, they allow a only one private repository, so you can put all your projects in there if you want them to be private. I would like to hear comments about this scenario.
如果您确实使用一个存储库,并且只有浅层项目:
否则,可能必须指定特定的文件扩展名以避免过多的递归:
但它可能会有点慢......并且如果项目确实如此,标签/分支可能会变得混乱是分开的。
注意:我几乎不会想到“Hello world!”值得拥有自己的存储库,只是因为它可能是“独立的”。
If you do go with one repository, and only have shallow projects:
Otherwise, may have to specify specific file extensions to avoid too much recursion:
It can be a little slow though... And tags/branches might get confusing if the projects really are separate.
Note: I hardly think "Hello world!" deserves its own repository just because it may be "stand alone".