使用 SVN(或 git)自动提交文件修改?
我几天来一直在阅读和寻找解决方案,但没有找到任何适合我需求的东西。
我们经常更新网站,这些网站由设计师和开发人员更新,大多数时候他们不会将更改提交到 SVN。
我正在研究持续集成类型的解决方案,当临时服务器上的“版本化”文件更新时,它会自动提交到 SVN。
CruiseControl 和我看过的其他工具不会这样做;有没有一个工具可以做到这一点,或者我们可以使用更好的流程?
感谢您的帮助!
克里斯
I've been reading and searching for a solution for a couple of days but haven't found anything that suits my needs.
We have frequently updated sites being updated by designers and developers that most of the time don't commit their changes to SVN.
I'm looking at continuous integration type solutions where, when a "versionned" file on the staging server gets updated, it is automatically committed to SVN.
CruiseControl and other tools I've looked at don't do this; is there a tool that does this or a better process we could use?
Thanks for any help!
Chris
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
我真的很喜欢你说的“更好的流程”,因为答案是肯定的。
让您的设计师和每个人都在存储库中工作。无论您选择 SVN 还是 git 还是其他东西,都没关系,但要使其成为“权威”副本。这样做最终会免除您的麻烦,因为您将拥有所有更改的清晰历史记录,并且可以随时恢复。
我为网页设计商店设置一些环境的方式是使用与您建议的系统相反的系统,它的工作原理如下:
我希望这可以帮助您在某种程度上思考您的流程。
回到你原来的问题:如果你真的不想改变你的进程,你可以设置一个 cron,它每隔几分钟运行一次,并添加/提交所有已更改的文件,这应该可以工作。但我不喜欢这样,因为现在你没有有意义的提交消息,并且更改历史记录也可能没有意义。当人们工作和保存文件时,他们没有意识到它们是在什么时候提交的,所以现在存储库中很可能存在处于损坏状态的修订,现在如何找到未损坏的修订?选择“自动化”提交显然不是最干净的解决方案。
I really like that you said "better process" because the answer there is yes.
Have your designers and everyone work from the repo. It doesn't matter if you choose SVN or git or something else, but make that the "authoritative" copy. Doing so will eventually save you headaches as you'll have a clear history of all changes, and can always revert.
The way I have setup a few environments for web design shops is with a system opposite to what you propose, it works like this:
I hope this helps you think about your process somewhat.
Back to your original question: If you really don't want to change your process, you could set up a cron, that runs every few minutes and adds/commits all files that haves changed, and that should work. But I don't like this because now you don't have meaningful commit messages and the change history also might not make sense. As people are working and saving files, they aren't realizing at what point they are being committed, so more than likely there are now revisions in the repository that are a broken state, and now how do you find revisions that aren't broken? Choosing to "automate" the committing is obviously not the cleanest solution.
我相信(虽然我还没有尝试过)你可以为看门狗编写一个观察者( http://packages. python.org/watchdog/ )将为您完成提交。
然而,我同意 ctcherry 的观点,即在破碎的状态下你会得到很多保存。你确实需要改变你的流程。
I believe (though I haven't tried it) that you could write an observer for watchdog ( http://packages.python.org/watchdog/ ) that would do the commit for you.
However, I agree with ctcherry that you are going to get a lot of saves in a broken state. You really need to change your process.
听起来您想在 Subversion 中使用 WebDAV 进行自动版本控制。 Subversion 和 WebDAV
我以前使用过这种方法。它的好处是你可以像 Windows/Linux 网络共享一样设置它。非技术人员只是将其视为存储文件的网络驱动器。每当用户在那里保存文档/文件时,它就会被静默提交。
Git 可能有类似的东西,但我没有这方面的经验。
Sounds like you want to use WebDAV for Autoversioning in Subversion. Subversion and WebDAV
I have used this methodology before. It is nice in that you can set it up like a windows/linux network share. Non-technical person just sees it as a network drive to store files on. Whenever the user saves a document/file there it is silently committed.
Git may have something similar, but I have not experience with that.
我不敢苟同。如果您要配置
阻止调用 SVN 命令行工具来为您提交代码,这不正是您所要求的吗?您可以使用
节点来确定哪些文件被修改。现在,虽然你可以这样做,但我也同意 @ctcherry 的观点,如果你直接投入生产,这可能会导致破坏代码被推送。
I would beg to differ. If you were to configure an
<exec>
block to make a call to the SVN command line tools to commit the code for you, wouldn't that do exactly what you're asking? You can use the<filesystem>
node to determine which files were modified.Now, though you could do this, I too agree with @ctcherry that this could cause breaking code to be pushed if you're going straight to production with this.
在开发者网站上,你可以开发一个工具来支持这个东西,你可以看到下面的代码,下面的代码支持你如何在SVN上进行自动提交,看看:)
任何反馈或问题,留下你的评论,我们可以讨论它
请参阅此处的代码:
查看更多信息:来自 此处
On the developer site, you can develop one tool for support this thing, you can see below code, the below code support you how to make Auto Commit on SVN, take a look :)
Any feedback or questions, leave your comment, we can discuss about it
Refer Code here:
view more info: from here