Is there an equivalent in svn like git add -u
? Basically, stage all the tracked files?
2 Answers
There is no equivalent because SVN doesn't have a staging area. The usual SVN workflow is:
- Edit your files or add new files
- Run
svn add <filename>
to tell SVN you'd like to start versioning this file (see note), if any. - Run
svn delete <filename>
to delete a file, if any. - Run
svn commit
to send all of the changes to the repository on the server.
So changes to files that are already under version control require nothing more than svn commit
to be sent to the remote repository; no staging is needed (or possible).
Note: Adding a file is almost like staging, but it's only for telling the next svn commit
command to include a file that previously was not a part of the repository. The same goes for the delete
command.

- 23,334
- 2
- 57
- 88
The answer to your question is No, but in several different pieces:
There is no command in Subversion which will remove all deleted-in-working-copy files. Subversion generally expects you to use its own commands (
svn copy
,svn move
,svn delete
) whenever you modify the name/existence of a file; in the case of copies or moves, this is needed to record the file's history, but for deletions it is purely an annoyance.When I have the problem of telling Subversion about many deletions, I usually use the following command. However, this command is unsafe if any pathnames contain spaces, and will also need to be adjusted if future versions of Subversion add columns to
status
output (this has happened in the past). (The “right” way to do this would be to usesvn status --xml
, but I don't know of a commonly available tool to select data from XML and run commands or produce output suitable forxargs -0
.)svn status | grep '?' | cut -c 9- | xargs rm
Because Subversion does not have staging as Git does, there is no such thing as staging changed files. The only way to have “unstaged” changes is to specify a list of files explicitly excluding those files when you commit.
This is not what you asked for, but it's closely related topic and useful but obscure: If you want to add all new files, you can use this command:
svn add --force .
The
--force
option when given tosvn add
actually means “if a versioned directory is found, recurse into it and add its children rather than skipping it” — it causessvn add .
to operate the waygit add .
does for untracked files.

- 37,492
- 13
- 80
- 108