如何使Subversion(或任何程序)执行定期提交? [英] How to make Subversion (or any program) perform periodic commits?
问题描述
我想配置计算机,使其每半小时自动提交我正在处理的程序.我正在使用svn信息库,因此即使只是每30分钟运行一次"svn ci"的脚本也可以.问题是我不知道该怎么做.
I want to configure my computer so that say every half an hour it automatically commits the program I am working on. I am using a svn repository so even if it was just a script that ran 'svn ci' every 30 min that would be okay. The problem is that I don't know how to do that.
有人可以告诉我,或引导我去做些什么,让我定期进行提交工作吗?
Could somebody please tell me, or direct me to something, that would let me get this periodic commit stuff working?
谢谢.
对不起,看来我对我为什么要这样做感到困惑.我要这样做的唯一原因是因为我的一位讲师希望我们了解代码随着时间的推移如何发展,并且我认为为此目的使用svn是一个好主意.最近的提交是否起作用并不重要.它只需要显示我对代码所做的更改.
Sorry it appears that I have confused people as to why I would want to do this. The sole reason that I want to do this is because a lecturer of mine wants us to know how our code develops over time and I thought that it would be a great idea to use svn for this purpose. It does not matter if the latest commit works or not. It just has to show the changes I have made to the code over time.
推荐答案
我不会因为这样的一系列自动提交而弄脏您的控件版本系统.但是我同意使用控制版本系统来提供该信息的想法.
I would not dirty your control version system with such series of auto commits. But I agree with the idea of using a control version system to provide that information.
然后,我的建议是:对您的软件使用一个存储库,对另一个存储自动提交的存储库.完成工作后,仅将一个逻辑提交合并到主存储库中的所有自动提交.
Then, my suggestion is: use a repository for your software and another one for store the auto commits. When the work is done, merge all auto commits in the main repository in only one logical commit.
使用git,我会这样做:
With git, I would do this:
- 回购'foo':主存储库
- Repo 'foo': the main repository
- refs/heads/...:您的开发分支机构的位置
- refs/sessions/...:带有肮脏提交的工作位置.
- "git init"
- "git remote add foo git://foo/...; git fetch foo"
- "git标签栏"
- "git push foo barbegin:引用/会话/您的用户ID/会话ID/开始"
- "git push foo barend:引用/会话/您的用户ID/会话ID/结束"
- "git rebase -i --to barbegin barbegin",然后按照进行操作在这里
- 我会压缩所有提交:最后只能有一个."
- "git push foo bar:master"#仅推送一次提交
- "git标签-d烧烤"
- "git标签-d barend"
- "git branch -d bar"
毕竟,我认为不能用此类数据收集有用的信息.因此,我将尽量避免这种工作流程.但是,如果真的需要,我会这样做.
After all this, I think no useful information may be gathered with such kind of data. So, I would try to avoid this workflow. But if really needed, I would do that way.
这篇关于如何使Subversion(或任何程序)执行定期提交?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!