Login | Join Now

Subversion Knowledge Base

5. Finding the status of a working copy

Products: Subversion 
Version: 1.3
First created: 10/13/06
Last updated: 10/18/06
Document number (KB 5)

Summary

Finding the status of your working copy

How do I find the status of my working copy?

In CVS, if you want to see what has changed in your working copy, odds are that you run cvs update. This command shows you the status of the files in your working copy, but it also updates your CVS working copy to the latest revision of the repository.* This not only requires a round-trip to the server, but also may change files in your working copy. Finding out what you've changed locally is different from finding out what has changed in the repository, but CVS mixes the two.**

With Subversion, if you want to find out what you've modified, you run svn status. This command compares the files in your working copy with those in the Subversion administrative areas (those pesky .svn directories), thus avoiding the necessity of a network round-trip:

$ svn status 
D fish.c
A shrimp.c
M anemone.c

Note that fish.c is scheduled for deletion, shrimp.c is scheduled for addition, and anemone.c has been modified.

Now, by default, svn status shows only the files that are interesting (like those that have been added, modified, or deleted). If you want to see information about all the files in your working copy, pass the --verbose switch:

$ svn status --verbose 
44 23 sally README
44 30 sally INSTALL
44 35 harry trout.c
D 44 19 ira fish.c
A 0 ? ? shrimp.c
M 0 ? ? anemone.c
44 36 harry things/rocks.txt

The first column remains the same, but the second shows the working revision of the item. The third and fourth columns show the revision in which the item last changed, and who changed it.

If you want to know which files will be updated the next time you run svn update, use the --show-updates switch to svn status:

$ svn status --show-updates --verbose 
* 44 23 sally README
44 30 sally INSTALL
* 44 35 harry trout.c
D 44 19 ira fish.c
A 0 ? ? shrimp.c
M * 44 32 sally anemone.c
44 36 harry things/rocks.txt

You can see that the files that will be updated are marked with a *.

* Unless you pass CVS the -n switch.

** CVS has a status command, but it is not very useful.

 

Support from CollabNet
Services from CollabNet