简体   繁体   English

什么时候不“ svn commit && svn更新”?

[英]When to not “svn commit && svn update”?

By no means a svn expert, I am wondering in what scenarios would you not want to svn update immediately after performing a svn commit , assuming* you are committing everything in your working copy. 绝不是svn专家,我想知道在什么情况下您希望在执行svn commit立即进行svn update ,假设*您正在提交工作副本中的所有内容。 Any practical examples/scenarios? 有实际的例子/场景吗?

In other words, why shouldn't everyone using SVN have an alias/function in place such as svn commit && svn update ? 换句话说,为什么每个使用SVN的人都不应该使用svn commit && svn update这样的别名/功能? (disregarding commit 's -m flag) (不考虑commit-m标志)

* I cite this assumption because I think it's generally supported to be a best practice when developing under version control, although there are of course occasional times to cut corners on this and I suspect that's the primary answer to my question. * 我引用了这个假设,因为我认为在版本控制下进行开发通常被认为是一种最佳实践,尽管当然有时偶尔会弯腰,我怀疑这是我的问题的主要答案。

What I actually use is a bash function for svn update && svn commit (with added -m, but I guess that depends on your preferences for how to submit commit messages). 我实际使用的是一个用于svn update && svn commit的bash函数(添加了-m,但是我想这取决于您如何提交提交消息)。

It could be svn update && svn commit && svn update , but unless you're working with a very large repository, odds are that your repository won't be significantly changed between the first and last updates. 可能svn update && svn commit && svn update ,但是除非您使用的是非常大的存储库,否则很有可能在第一次更新和最后一次更新之间不会显着更改存储库。

Right. 对。 Perhaps it's worth clarifying that all updating (including resolving any conflicts), re-building, and testing has been performed so now you're ready to really commit. 也许值得澄清的是,所有更新(包括解决所有冲突),重新构建和测试均已执行,因此现在您可以真正提交了。 That's the starting point for my question. 这是我提出问题的出发点。

I can't think up a case when you should not or must not run svn update after running svn commit . 我想不出在运行svn commit之后不应该或不应该运行svn update Assuming that all the stuff quoted above has been performed, why not to do an svn update ? 假设上面引用的所有内容均已执行,为什么不进行svn update At the same time, why would you want to run svn update ? 同时,为什么要运行svn update

Run svn update the next time you start working on the task, the next time you see commits in the feature branch you are working on (or any other branch or trunk that you are workin on at that moment) and make sure to run svn update before you commit your changes. 下次您开始处理任务时,下次运行svn update ,下次在您正在处理的功能分支(或当时正在使用的任何其他分支或主干)中看到提交时,请确保运行svn update提交更改之前。

The main rule here is to run svn update often to ensure that there are no conflicts with your work and the work of others (assuming you modify the same files). 这里的主要规则是经常运行svn update以确保与您的工作以及其他人的工作没有冲突(假设您修改了相同的文件)。

Read SVNBook: 阅读SVNBook:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM