如何在 Unix 中执行批量 svn mv [英] How to do a bulk svn mv in Unix

查看:39
本文介绍了如何在 Unix 中执行批量 svn mv的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在 svn 中将大量文件从一个目录批量移动到另一个目录.不幸的是,svn 一次只支持移动一个文件.

I want to bulk move a large number of files from one directory to another in svn. Unfortunately svn only supports moving one file at a time.

基本上我想将某种类型的文件(.xml)移动到一个完全不同的目录,例如mv foo/bar/.xml forbar/xml

Basically I want to move files of a certain type (.xml) to a completely different directory e.g. mv foo/bar/.xml forbar/xml

我尝试使用 find 并使用 -exec 但我需要为第二个参数剥离目录.有什么想法吗?

I tried playing around with find and using -exec but I need to strip the directory off for the second argument. Any ideas?

使用 bash

推荐答案

您可以使用 -execdir 选项来实现.这源文件所在的目录运行(这避免了目录链接等的竞争条件).

You can do it with the -execdir option. This runs from the directory that the source files are in (which avoids race conditions with directory linking and etc).

find -name '*.xml' -execdir svn move {} `pwd`/foobar/{} \;

这篇关于如何在 Unix 中执行批量 svn mv的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆