svn 一次全部提交(队列)?
我在 Windows 上使用 Tortoise svn 客户端,并且我需要能够在一次提交中一次性提交来自不同子文件夹的更改文件。比如在提交之前将文件添加到队列或类似的事情?我怎样才能做到这一点?
Windows 上是否有另一个 svn 客户端可以做到这一点?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(8)
如果它们都是同一存储库的一部分,那么您只需从该存储库的根文件夹提交即可。如果它们来自不同的存储库,那么这个概念有点没有意义,因为您将对不同的存储库进行单独的提交,因此它不能真正是“一次提交”。如果您的子文件夹都是不同的存储库,但您只想在客户端上执行 1 次提交操作来提交所有这些,那么您可以制作某种 .bat 脚本来迭代子文件夹并使用以下命令运行相同的提交命令相同的提交消息。
也许添加更多关于这些“子文件夹”是什么的细节?
If they are all part of the same repository, then you would just commit from the root folder of that repository. If they are from different repositories, then the concept somewhat doesn't make sense, because you would be making separate commits to separate repositories, so it can't really be "one commit". If you have subfolders that are all different repositories but you just want to perform 1 commit operation on the client to commit them all, then you could just make some kind of .bat script to iterate over the subfolders and run the same commit command with the same commit message.
Maybe add more detail as to what these "subfolders" are?
尝试从您的顶级文件夹提交。它将向您显示已修改和未版本化的文件,即使它们位于子文件夹中。
Try to commit from your top folder. It will show you the modified and unversionned files , even if they are in subfolders.
因此,我经常在 TortoiseSVN 中使用的一项功能(我认为可能与您的请求类似)是将文件夹或文件拖到提交对话框中。只要它们都位于单个根工作文件夹下,它就会弄清楚并让您在一次提交中提交它们。这是一个非常方便的功能,我一直在使用。
我希望看到 Araxis Merge 提供的对该功能的进一步扩展。您可以右键单击文件或文件夹,然后选择“比较队列”:
然后,当您右键单击另一个文件夹/文件时,它允许您与排队的一个或多个项目进行比较:
我真的希望 Tortoise shell 支持“提交队列”,然后添加“提交(队列中+n)”菜单(如果队列不存在)不空。
So, one feature that I use frequently with the TortoiseSVN that I think might be similar to your request is dragging folders or files on to the commit dialog. As long as they are all under a single rooted working folder, it will figure that out and let you commit them in a single commit. It's a very handy feature that I use all the time.
A further extension of this feature that I would like to see is what Araxis Merge provides. You can right click on a file or folder, then select 'Queue for Comparison':
Then when you right-click another folder/file it allows you to do a comparison with the one or more items that were queued up:
I'd really like the Tortoise shell to support 'Queue for Commit', then adding a 'Commit (with +n in queue)' menu if the queue isn't empty.
它们都在同一个存储库中吗?如果是这样,只需转到工作副本的根目录并从那里提交
Are they all in the same repository? If so, just go to the root of your working copy and commit from there
从子目录中转到 1 个目录,右键单击,然后从那里选择“SVN Commit..”。然后在“所做的更改”窗格中,仅选择(和所有)您想要立即提交的子目录。
Go up 1 directory from the subdirectories, right click, and "SVN Commit.." from there. Then in the "Changes made" pane, select only (and all) the subdirectories that you would like to commit at once.
您可以使用更改列表功能 subversion(也可在 TortoiseSVN > 1.5 中找到),允许您可以创建要提交的与同一功能相关的文件列表。
You can use the changelist feature of subversion (which is also available in TortoiseSVN > 1.5), that allows you to create a list of files to commit related to the same feature.
如果您的工作副本具有所有这些文件夹的根目录,您可以转到该根目录并提交。如果您在没有根目录的情况下单独签出了这些子文件夹,则必须进行多次提交。
If your working copy has the root of all these folders, you can go to this root and commit. If you had checked out these subfolders separately without the root, you have to make multiple commits.
已经提供的几个答案基本上给出了相同(正确)的答案——从工作副本根提交。但我认为提供更多细节是有用的。
首先,从根提交并不意味着您必须提交所有内容(以防您担心尚未提交一些不相关的编辑)。提交对话框允许您从所有更改的文件集中选择或取消选择。
其次,也许与您的问题最相关的是,无论您选择提交多少个文件,提交操作都是原子,即它提交所有文件,或者如果有的话其中任何一个或多个存在问题,则无。因此,Subversion 保证将您的更改组合在一起作为单个更改集。
第三,需要注意的一点虽然关系不太直接,但仍然值得一提:重要的是要注意 Subversion 操作(在存储库浏览器之外)在两阶段下运行流程:首先进行本地更改,然后提交更改。对于编辑操作来说,这几乎是一个同义反复:首先编辑,然后提交;编辑本身的行为不会影响存储库。很明显,对吧?当您考虑添加操作时,这一点并不是那么明显:首先添加,然后提交;添加的行为也不会影响存储库!因此,在构建更改集<时,将其与您的问题联系起来,编辑各种文件,添加各种文件,删除各种文件等。 /强>。完成此操作后,从工作副本的根目录打开提交对话框,选择更改集中的所有文件,然后通过一个原子操作提交它们。
Several of the answers already provided give essentially the same (correct) answer--commit from your working copy root. But I think it is useful to give just a couple more details.
First, committing from the root does not imply you have to commit everything (in case you are concerned about not yet committing some unrelated edits). The commit dialog lets you select or deselect from the set of all changed files.
Second, and perhaps most relevant to your question, regardless of how many files you select to commit, the commit operation is atomic, i.e. it commits all the files or, if there was a problem with any one or more of them, it commits none. Thus, Subversion guarantees to keep your changes grouped together as a single change set.
Third, a point to be aware of that relates slightly less directly, but is still worth mentioning here: it is important to be aware that Subversion operations (outside the repo-browser) operate under a two-stage process: first you make a local change, then you commit the change. This seems almost a tautology when it comes to the edit operation: first you edit, then you commit; the act of editing itself does not affect the repository. Obvious, right? This is not nearly so obvious when you consider the add operation: first you add, then you commit; the act of adding also does not affect the repository! So relating this to your question, edit various files, add various files, delete various files, etc., as you build your change set. Once you have done that, open the commit dialog from the root of your working copy and select all the files in your change set and commit them in one atomic operation.