Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove a file with @ in it's name from svn in command line?

Tags:

svn

With the new iPhone 2x files i've stumbled uppon this problem...

like image 248
CiNN Avatar asked Aug 18 '10 11:08

CiNN


People also ask

How do I delete a file from a commit in svn?

Using svn to delete a file from your working copy deletes your local copy of the file, but merely schedules it to be deleted from the repository. When you commit, the file is deleted in the repository. $ svn delete myfile D myfile $ svn commit -m "Deleted file 'myfile'." Deleting myfile Transmitting file data .

How do I change a filename in svn?

Renaming a file. Normally you can just use SVN Rename on the context menu. This is analogous to the Move command described in the Moving or Copying a file recipe. It is almost as if you are doing two separate steps: an Add operation with the new name and a Delete operation of the old name.

What does svn RM do?

@Nyerguds That's correct, as the svn rm is removing the files from the repository. In the event you wish to remove files from the repo, BUT keep them locally on your machine then you'd use the flag above.

How do I delete a working copy in svn?

Assuming you use the latest Syncro SVN Client version, to remove the working copy from Desktop: remove the working copy from Syncro SVN Client; For this, press the button with a folder on it, next to the working copies combo box (in the Working Copy view). From the opened dialog box, remove the Desktop working copy.


1 Answers

You need to add a "@" sign in the end to get SVN to process the file.

For example, if you had a file called [email protected] which you want to add to SVN, you would type:

svn add [email protected]@

If you have lots of files with the "@" symbol in their name that you want to process in a batch (i.e. use * wildcard), you can do something like this in OS X Terminal:

find . -name "*@*" | xargs -I % svn add %@

The above command will use the find utility to list out each file with @ in its filename and then pipe each filepath to SVN using XARGS.

For each filepath, XARGS will execute the provided command svn add %@, except that -I % tells XARGS to replace each occurrence of "%" in the provided command, with the filepath piped. XARGS effectively appends the special "@" at the end of the filename.

For example, after replacing the "%" character, XARGS will execute svn add path/to/your/[email protected]@; SVN will accept this (presumably because SVN looks for the last occurrence of "@" and treats this as a revision specifier)

Hope this helps - I had to whack my head for a bit to add the gazzilion @2x.png files that were needed for my app to be upgraded for iOS4.0

like image 82
bhavinb Avatar answered Sep 20 '22 15:09

bhavinb