我的工作场所正在考虑迁移到现代 (D)VCS,这是我正在推动的事情。
我的老板同意这个想法,当前的工作流程是建立一个集中存储库,每个人都可以在任务完成后提交/合并他们的更改,在处理任务时,每个开发人员都可以拥有自己的分支来处理和提交。
问题是他不太喜欢这样的想法:人们只有在将更改推送到共享存储库之前才在工作站上拥有代码。这是因为磁盘故障等原因。
他希望看到的是每个人在服务器上都有自己的分支,当您在本地工作站上提交时,该分支会自动更新。
是否有任何 DVCS 以易于设置的方式支持此功能?
请注意,我个人认为每个开发人员承担备份其代码的责任是完全可以接受的,例如只需将其更改推送到远程服务器上的私有分支。这可以手动完成,也可以使用 cron 脚本自动完成。
My workplace is considering moving to a modern (D)VCS which is something that I am pushing for.
My boss is in on the idea and the current workflow would be to have a centralized repository where everyone can commit/merge their changes when a task is done, While working on a task each developer can have their own branch to work on and commit to.
The problem is that he is not very fond of the idea that people have code on their workstations only until the changes are pushed into the shared repository. This is because of disk failures and so on.
What he would like to see is that everyone had their own branch on the server which would automatically be updated when you commit on your local workstation.
Does any DVCS support this in an easy to setup way?
Note though that I personally think it is perfectly acceptable for each developer to take responsibility of backing up their code by for example simply pushing their changes to a private branch on the remote server. This could be done manually or automatically with a cron script.
发布评论
评论(4)
只是为了“我们也是”因素:这在 Mercurial 中是可行的,就像在 bzr 和 git 中一样。只需使用一个提交钩子,在可用时推送到更集中的存储库。像这样的事情:
我要注意的一件事是,与通过挂钩强制执行此操作相比,您可以使推送到中央存储库对个人开发人员有吸引力,并且您会发现他们自己做这件事。我为让人们提交/推送(每天/每小时)所做的事情:
Just for the "us too" factor: this is doable in mercurial as it is in bzr and git. Just use a commit hook that pushes to a more central-ish repo when available. Something like this:
One thing I'll note is that rather that enforcing this via hooks you can make pushing to central repo attractive to individual developers and you'll find they do it on their own. Things I've done to get people committing/pushing (daily/hourly):
您可以准备一个提交后挂钩(请参阅本地存储库中的
.git/hooks/post-commit.sample
)以自动将当前分支推送到服务器。如果这样做,我认为共享服务器上的分支名称应该以开发人员的名称作为前缀,以防止名称冲突。
You can prepare a post-commit hook (see
.git/hooks/post-commit.sample
in your local repository) to automatically push the current branch to the server.If you do this, I think the branch names on the shared server should be prefixed with developer's name to prevent name conflicts.
这听起来与我们目前在 Bazaar 上的设置非常相似,但我认为它可以在 Mercurial 和其他人中使用 Git 中的提交后挂钩或 Mercurial 中的“提交后推送”进行复制。在 Bazaar 中执行此操作的方法是执行以下操作:
所有分支都将保存在 /path/to/server/project 的存储库中。对本地工作副本的任何提交都会自动推送到服务器。如果您使用 GUI,您可以安装我的 remote-feature-branches 插件,该插件会自动执行使用主干分支创建新存储库并在本地检查它的过程(上面的前三个命令)。
我只使用过一点 Mercurial,但我相信您执行此操作的方法是在服务器上建立一个分支,并在本地对其进行分支并编辑 .hgrc 文件以包括:
所有用户都将拥有一个本地副本在本例中包含所有分支,而在 Bazaar 中,本地副本仅包含他们正在处理的分支的历史记录。实现略有不同,但我认为功能大致相同。
This sounds fairly similar to the set-up that we have with Bazaar at the moment, but I think it can be replicated in Mercurial and others using post-commit hooks in Git or "push-after-commit" in Mercurial. The way of doing this in Bazaar would be to do something like this:
All the branches will be held in a repository at /path/to/server/project. Any commits to the local working copy will be pushed to the server automatically. If you use GUIs, you can install my remote-feature-branches plugin, which automates the process of creating a new repository with a trunk branch and checking it out locally (the first three commands above).
I've only used Mercurial a little, but I believe that the way you'd do this would be to have a branch on the server and to branch it locally and edit the .hgrc file to include:
All users would have a local copy that contains all branches in this case, whereas in Bazaar, the local copy would only have the history of the branch that they were working on. Slightly different implementations, but functionally much the same I think.
看起来您的老板正在努力获得 DVCS 的能力,但也希望在“办公室”工作时拥有集中式 SCM。
是的,那你为什么不看看 Plastic SCM呢?这正是我们所做的:您可以采用分布式工作,或者(更“企业友好”)您可以集中工作(或两者的组合)。而且这仍然是关于分支的。
看看这两篇文章:
http://codicesoftware.blogspot.com/2010/08/branch-per -task-workflow-explained.html
http://codicesoftware.blogspot.com/2010/03/distributed-development-for-windows.html
也许也在这里:
http://www. Plasticscm.com/features/task-driven-development.aspx
Looks like your boss is working for the ability to have a DVCS but also wants to have a centralized SCM while working "at the office".
It that's correct, then why don't you take a look at Plastic SCM? That's exactly what we do: you can go distributed or (more "enterprise friendly") you can work centralized (or a combination of the two. And still it is all about branching.
Take a look at these two articles:
http://codicesoftware.blogspot.com/2010/08/branch-per-task-workflow-explained.html
http://codicesoftware.blogspot.com/2010/03/distributed-development-for-windows.html
And maybe here too:
http://www.plasticscm.com/features/task-driven-development.aspx