Dogsbody
Dogsbody

Reputation: 294

svn update without moving into that directory

I need to do a number of svn updates on a server. Is it possible to do an svn update without moving into that directory?

Just trying to keep things tidy instead of cd'ing around all over the server :-)

Thank you in advance

Upvotes: 2

Views: 738

Answers (3)

Skippy Fastol
Skippy Fastol

Reputation: 1775

An extra for you, as I liked your question. Let's assume the list of directories you are handling is a, b, c ... z.

You can do this to spare you some extra lines :

for DIR in a b c ... z; do svn update $DIR; done

(Bash syntax).

And if you are in a hurry, and want those updates to occur simultaneously (will require that the directories are in separate trees, i.e., that they have no common .svn in any of their parent directories), then you'll run the updates in background !

for DIR in a b c ... z; do svn update $DIR & done

Upvotes: 0

Nishant
Nishant

Reputation: 55866

$ svn help update

update (up): Bring changes from the repository into the working copy.
usage: update [PATH...]

  If no revision is given, bring working copy up-to-date with HEAD rev.
  Else synchronize working copy to revision given by -r.

  For each updated item a line will start with a character reporting the
  action taken.  These characters have the following meaning:

so, things like

svn update /home/naishe/workspace

will work

Upvotes: 2

Michael Berkowski
Michael Berkowski

Reputation: 270637

Yes, just

svn update /path/to/dir/to/update

Works just fine. There's no need to be in the directory when updating it.

Likewise, you can update individual files.

svn update /path/to/dir/to/update/config.ini

(tested on Subversion 1.6.17)

Upvotes: 3

Related Questions