Status "S" in Subversion

SvnSwitch StatementStatus

Svn Problem Overview


At some point all files in my working copy got marked with "S" symbol as shown below:

$ svn st
M    S   AclController.php
     S   InstallationController.php
     S   CustomerController.php
     S   RedirController.php
     S   IndexController.php
     S   LoginController.php
     S   OrderController.php
     S   ProductController.php
     S   SelfInstallController.php
     S   SelfcareController.php

Interestingly it occurs only int this particular working copy - when I checkout the project to new directory, it does not show the "S" marks.

How to get rid of this annoying "S" symbols? It significantly decreases clarity of WC status.

Update: I do switch from time to time using standard svn switch syntax. It was never causing this "S" symbol to appear until recently. The command used to switch was:

svn switch svn+ssh://xxxxxx/subversion/xxxxxxx/releases/1.0.16 .

Is there any way I can clear the "S" flag?

Svn Solutions


Solution 1 - Svn

It means that the files are from a different location in your subversion repository than the directory containing them. The solution is to switch the entire working copy to the same location. See the two sections in the subversion book for details on how to invoke the command.

Solution 2 - Svn

If you call 'svn info' on the directory itself and on (one of) the files inside you will get two different URLs.

You get the 'S' status if the url of a file/directory does not match the URL of the parent followed by the name of the file.

Can you post the url of the parent and one of the child nodes? (anonymizing the URL where appropriate)

Solution 3 - Svn

I had 'S' status while switching from trunk (r100) to some branch (r50). I got the error :

svn: Failed to add file 'web/.htaccess': an unversioned file of the same name already exists

All web/'s subdirs were 'S' flagged.

The cause : i had deleted .htaccess to svn:ignore it (r100), then had created it again (unversioned and ignored). The branch (r50) still had web/.htaccess in the repo.

The solution :

mv web/.htaccess ../../
svn switch back to trunk
svn switch to branch again

Everything's fine.

Solution 4 - Svn

I had this problem with a directory I successfully committed to SVN. The solution for me was to erase it locally then update. I couldn't see any differences, but the .svn file was fixed for whatever reason (no more S).

Solution 5 - Svn

This is usually caused by an interruption when switching branches.

Switch to a different branch, and then switch back to the branch you really want.

svn switch some_other_branch_url

svn switch desired_branch_url

Solution 6 - Svn

Just a remark: I got the same S symbol when I checked out a deleted directory from the same location in the repository but using a different URL, i.e., using distinct protocols to checkout like 'svn checkout svn+ssh://[email protected]...' against 'svn checkout --username user https://scm.gforge....';. I solved it by checking it out again by using the same URL that I used for the first checkout.

Solution 7 - Svn

In case anyone is coming in late looking for the answer (which is stated correctly above), I believe a likely CAUSE of this situation is an 'svn switch' on a parent directory that fails (as in the case of a local uncommitted file with the same name, and no --force option), leaving all files subsequent to the failure 'un-switched'.

That is why (assuming the original issue is later corrected) a subsequent 'svn switch' again on the same parent directory will indeed switch the remaining un-switched files to a new repo path.

Solution 8 - Svn

This means that you've switched from one working copy to another, for example you've checked out a working copy, then swapped it over to be comparing against a code branch. Take a look at the [SVN book][1] for details on how to undo this.

[1]: http://svnbook.red-bean.com/en/1.5/ "SVN Book on switching"

Solution 9 - Svn

There's another way in which this status can be achieved - which hopefully will save someone some time tracking it down.

I unpacked an external library into my SVN root, and it turns out the third-party author has accidentally included their own .svn folder in one of their folders. This of course overwrites our own, correct, subversion folder, and has the same effect as described elsewhere on this page - a folder appears to have switched unexpectedly to another branch.

Solution 10 - Svn

"Item is switched."

If you used "svn switch" on your working copy that might explain it?

Solution 11 - Svn

A simple solution to get rid of the 'S' when you issue

svn status

is to just go to the dir that is marked with 'S' and delete the hidden .svn directory:

> rm -rf .svn

Afterwards the sources show up marked with '?' and you could easily add them freshly:

> svn add path/to/resource

Solution 12 - Svn

For me this happens when "svn switch" command is interrupted and to solve it with TortoriseSVN, I right click on the file and select switch back to parent

Solution 13 - Svn

In my case two sub-directories in the branch were deleted in the trunk. I switched from trunk the branch from the top level directory, and then moved back to trunk and experience the problem with those sub-directories are now in status S.

I used the answer by @ahnbizcad as a guideline. From the parent directory (which is itself under the top level directory) of the sub-directories:

svn sw <branch_url>

svn sw <trunk_url>

Solution 14 - Svn

I suggest you read its official help, try:

svn st --help

or

svn st --help | grep S

'S' the item has a Switched URL relative to the parent

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionMichał NiedźwiedzkiView Question on Stackoverflow
Solution 1 - SvnAndrew AylettView Answer on Stackoverflow
Solution 2 - SvnBert HuijbenView Answer on Stackoverflow
Solution 3 - SvnsglessardView Answer on Stackoverflow
Solution 4 - SvnEliView Answer on Stackoverflow
Solution 5 - SvnahnbizcadView Answer on Stackoverflow
Solution 6 - SvnAndré LageView Answer on Stackoverflow
Solution 7 - SvnJohn KennedyView Answer on Stackoverflow
Solution 8 - Svnme_andView Answer on Stackoverflow
Solution 9 - SvnhalferView Answer on Stackoverflow
Solution 10 - Svnstiank81View Answer on Stackoverflow
Solution 11 - SvnTorsten BarthelView Answer on Stackoverflow
Solution 12 - SvnAlireza FattahiView Answer on Stackoverflow
Solution 13 - SvnSoumya KantiView Answer on Stackoverflow
Solution 14 - SvnSiweiView Answer on Stackoverflow