将文件夹与 Subversion 存储库同步
有没有一种快速的方法,命令行工具或其他工具,可以查看文件夹并计算出添加新文件、删除旧文件、更新现有文件然后提交所有内容所需的 SVN 操作?
我通过 nant 将其连接起来,不想自己费力去做。
谢谢
Is there a quick way, command line tool or whatever, that will look at a folder and work out the SVN operations required to add new files, delete old ones, update existing and then commit everything?
I'm hooking this up via nant and don't want to have to mess around doing it myself.
thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以构建一个脚本来解析
svn status
的输出(如果您愿意,可以添加--xml
)并删除不再存在的内容(!
),添加未版本化的内容(?
),然后提交所有内容。You could build a script that parses the output of
svn status
(you can add--xml
if you like) and deletes whatever isn't there anymore (!
), adds whatever is unversioned (?
) and then commits everything.我假设您想要自动同步的文件夹是版本控制的文件夹?
如果是这种情况,只需运行
即可将所有新文件添加到版本控制中。
如果您更新了现有文件,svn 将自动检测这些文件。 此外,您删除的文件将被 svn 检测为“丢失”,当您提交“syncedfolder”时,这些丢失的文件将自动在存储库中删除。
I assume the folder you want do sync automatically is a versioned folder?
If that's the case, just run
to add all new files to version control.
If you have updated existing files, svn will detect those automatically. Also, files that you have deleted will be detected by svn as 'missing' and when you commit the 'syncedfolder', those missing files will automatically get deleted in the repository.