Renamed file, now SVN not allowing me to commit?

2020-02-17 06:20发布

I'm developing a ColdFusion website using Aptana. We're using SVN for version control.

I renamed a few files and am now trying to commit one of them, but I'm getting the following error:

'SVN Commit' has encountered a problem.
org.apache.subversion.javahl.ClientException: Illegal target for the requested operation
svn: Commit failed (details follow):
svn: Cannot commit 'R:\myPath\My-New-File-Name.cfm' because it was moved from 'R:\myPath\My-Old-File-Name.cfm' which is not part of the commit; both sides of the move must be committed together

This seems to indicate that I need to commit both the previous file (that was renamed) and the new renamed file together. How can I commit a file that no longer exists...?

标签: svn commit
10条回答
相关推荐>>
2楼-- · 2020-02-17 06:31

If things really get messed up, the simplest solution is to delete the folder from the repository and then add it back in its current form.

SVN Wipe and Replace:

  1. Copy the folder containing all of your changes to a temporary location.
  2. Use SVN Delete on the folder and then commit.
  3. Copy the backup copy back to your working copy and commit.
查看更多
够拽才男人
3楼-- · 2020-02-17 06:32

If you're using IntelliJ IDEA and make commit with TortoiseSVN, sometimes, it happens that the folder is not deleted by IDEA and Subversion make this error.

In that case, that means "please, don't commit a folder/file you marked as deleted"

查看更多
闹够了就滚
4楼-- · 2020-02-17 06:32

TortiseSVN open the file in windows explorer. select the file,right click,use TortiseSVN->unversion and add to ignore list

then the file will get rid of the SVN,becomes normal file. thus you can do the operation to add the file to SVN,and submit it.

i use the solution solve to the issue.

查看更多
Fickle 薄情
5楼-- · 2020-02-17 06:34

Commit the directory, not the file.

Think of a directory as a text file containing the list of files it contains, then you can see that to commit successfully, you need to update the directory itself so it can remove the old entry and add the new entry. This will show up in SVN as deleting the old and adding the new file (ie 2 changes to the directory, not 1 change to the file)

If only want to commit the 1 file, you will need to add the other changed files to an ignore list temporarily.

查看更多
该账号已被封号
6楼-- · 2020-02-17 06:41

svn commit 'R:\myPath\My-New-File-Name.cfm' 'R:\myPath\My-Old-File-Name.cfm' -m "message"

works for me. You just also need to include the deleted file.

查看更多
戒情不戒烟
7楼-- · 2020-02-17 06:44

There is a chance that one of the files is renamed.

Look at the file names in the error and see if this matches with your files.

If the file names don't match, rename your file to the one in the error and commit all the files you wanted to commit. After this you can rename your file and commit again.

查看更多
登录 后发表回答