如何在TortoiseSVN中将文件(或文件夹)从一个文件夹移动到另一个文件夹?

时间:2022-11-15 19:47:54

I would like to move a file or folder from one place to another within the same repository without having to use Repo Browser to do it, and without creating two independent add/delete operations. Using Repo Browser works fine except that your code will be hanging in a broken state until you get any supporting changes checked in afterwards (like the .csproj file for example).

我想将文件或文件夹从同一个存储库中的一个地方移动到另一个地方,而不必使用Repo Browser来执行此操作,也无需创建两个独立的添加/删除操作。使用Repo浏览器工作正常,除了您的代码将处于断开状态,直到您之后检查任何支持更改(例如.csproj文件)。

Update: People have suggested "move" from the command line. Is there a TortoiseSVN equivalent?

更新:人们建议从命令行“移动”。是否有TortoiseSVN等价物?

10 个解决方案

#1


431  

To move a file or set of files using Tortoise SVN, right-click-and-drag the target files to their destination and release the right mouse button. The popup menu will have a SVN move versioned files here option.

要使用Tortoise SVN移动文件或文件集,请右键单击并将目标文件拖到目标位置并释放鼠标右键。弹出菜单将在此处具有SVN移动版本化文件选项。

Note that the destination folder must have already been added to the repository for the SVN move versioned files here option to appear.

请注意,目标文件夹必须已添加到存储库,以便显示SVN移动版本化文件选项。

#2


59  

svn move — Move a file or directory.

svn move - 移动文件或目录。

http://svnbook.red-bean.com/en/1.0/re18.html

#3


21  

In Windows Explorer, with the right-mouse button, click and drag the file from where it is to where you want it. Upon releasing the right-mouse button, you will see a context menu with options such as "SVN Move versioned file here".

在Windows资源管理器中,使用鼠标右键单击并将文件从它所在的位置拖动到所需位置。释放鼠标右键后,您将看到一个上下文菜单,其中包含“SVN Move versioned file here”等选项。

http://tortoisesvn.net/most-forgotten-feature

#4


6  

Under TortoiseSVN, see the following page: http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug-copy.html

在TortoiseSVN下,请参阅以下页面:http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug-copy.html

#5


5  

If you want to move files around and keep the csproj files up to date, the easiest way is to use a Visual Studio plugin like AnkhSVN. That will automatically commit both the move action (as an delete + add with history, because that's how Subversion works) and a change in the .csproj

如果你想移动文件并保持csproj文件是最新的,最简单的方法是使用像AnkhSVN这样的Visual Studio插件。这将自动提交移动操作(作为删除+添加历史记录,因为这是Subversion的工作方式)和.csproj中的更改

#6


4  

From the command line, you can type svn mv path1 path2. This will create an add and a delete operation, but there's not really a way around that - as far as I know - in Subversion.

从命令行,您可以键入svn mv path1 path2。这将创建一个添加和删除操作,但据我所知,在Subversion中并没有真正的方法。

#7


3  

Subversion does not yet have a first-class rename operations.

Subversion还没有一流的重命名操作。

There's a 6-year-old bug on the problem: http://subversion.tigris.org/issues/show_bug.cgi?id=898

这个问题有一个6岁的错误:http://subversion.tigris.org/issues/show_bug.cgi?id = 898

It's being considered for 1.6, now that merge tracking (a higher priority) has been added (in 1.5).

它被考虑用于1.6,现在已经添加了合并跟踪(更高优先级)(在1.5中)。

#8


1  

Use Tortoise's RENAME command, and type in a relative path ("folder/file.ext").

使用Tortoise的RENAME命令,输入相对路径(“folder / file.ext”)。

#9


0  

As mentioned earlier, you'll create the add and delete commands. You can use svn move on both your working copy or the repository url. If you use your working copy, the changes won't be committed - you'll need to commit in a separate operation.

如前所述,您将创建添加和删除命令。您可以在工作副本或存储库URL上使用svn move。如果使用工作副本,则不会提交更改 - 您需要在单独的操作中提交。

If you svn move a URL, you'll need to supply a --message, and the changes will be reflected in the repository immediately.

如果您移动URL,则需要提供--message,并且更改将立即反映在存储库中。

#10


0  

Use the svn move command to move file/folder.

使用svn move命令移动文件/文件夹。

#1


431  

To move a file or set of files using Tortoise SVN, right-click-and-drag the target files to their destination and release the right mouse button. The popup menu will have a SVN move versioned files here option.

要使用Tortoise SVN移动文件或文件集,请右键单击并将目标文件拖到目标位置并释放鼠标右键。弹出菜单将在此处具有SVN移动版本化文件选项。

Note that the destination folder must have already been added to the repository for the SVN move versioned files here option to appear.

请注意,目标文件夹必须已添加到存储库,以便显示SVN移动版本化文件选项。

#2


59  

svn move — Move a file or directory.

svn move - 移动文件或目录。

http://svnbook.red-bean.com/en/1.0/re18.html

#3


21  

In Windows Explorer, with the right-mouse button, click and drag the file from where it is to where you want it. Upon releasing the right-mouse button, you will see a context menu with options such as "SVN Move versioned file here".

在Windows资源管理器中,使用鼠标右键单击并将文件从它所在的位置拖动到所需位置。释放鼠标右键后,您将看到一个上下文菜单,其中包含“SVN Move versioned file here”等选项。

http://tortoisesvn.net/most-forgotten-feature

#4


6  

Under TortoiseSVN, see the following page: http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug-copy.html

在TortoiseSVN下,请参阅以下页面:http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug-copy.html

#5


5  

If you want to move files around and keep the csproj files up to date, the easiest way is to use a Visual Studio plugin like AnkhSVN. That will automatically commit both the move action (as an delete + add with history, because that's how Subversion works) and a change in the .csproj

如果你想移动文件并保持csproj文件是最新的,最简单的方法是使用像AnkhSVN这样的Visual Studio插件。这将自动提交移动操作(作为删除+添加历史记录,因为这是Subversion的工作方式)和.csproj中的更改

#6


4  

From the command line, you can type svn mv path1 path2. This will create an add and a delete operation, but there's not really a way around that - as far as I know - in Subversion.

从命令行,您可以键入svn mv path1 path2。这将创建一个添加和删除操作,但据我所知,在Subversion中并没有真正的方法。

#7


3  

Subversion does not yet have a first-class rename operations.

Subversion还没有一流的重命名操作。

There's a 6-year-old bug on the problem: http://subversion.tigris.org/issues/show_bug.cgi?id=898

这个问题有一个6岁的错误:http://subversion.tigris.org/issues/show_bug.cgi?id = 898

It's being considered for 1.6, now that merge tracking (a higher priority) has been added (in 1.5).

它被考虑用于1.6,现在已经添加了合并跟踪(更高优先级)(在1.5中)。

#8


1  

Use Tortoise's RENAME command, and type in a relative path ("folder/file.ext").

使用Tortoise的RENAME命令,输入相对路径(“folder / file.ext”)。

#9


0  

As mentioned earlier, you'll create the add and delete commands. You can use svn move on both your working copy or the repository url. If you use your working copy, the changes won't be committed - you'll need to commit in a separate operation.

如前所述,您将创建添加和删除命令。您可以在工作副本或存储库URL上使用svn move。如果使用工作副本,则不会提交更改 - 您需要在单独的操作中提交。

If you svn move a URL, you'll need to supply a --message, and the changes will be reflected in the repository immediately.

如果您移动URL,则需要提供--message,并且更改将立即反映在存储库中。

#10


0  

Use the svn move command to move file/folder.

使用svn move命令移动文件/文件夹。