Alex Spurling
Alex Spurling

Reputation: 55854

SVN move the contents of a directory into its parent

I'm having trouble figuring out the svn commands needed to move the contents of a directory up one level into its parent and then deleting that directory. In unix I would do:

$ cd ~/parentdir/subdir
$ mv * ..
$ cd ..
$ rm -r subdir

Now all the files that were under subdir are now in parentdir and subdir is now gone. How would I do the same in SVN while maintaining the history of those files?

Upvotes: 1

Views: 1085

Answers (2)

jeroen van gorkum
jeroen van gorkum

Reputation: 1

[this is really a comment, but i'm lacking the reputation for it]

use $ svn cp * .[^.]* .. instead if you want to copy dotfiles and .folders/, too.

found at Super User, which shows alternate ways to do the same.

Upvotes: 0

malenkiy_scot
malenkiy_scot

Reputation: 16605

$ cd ~/parentdir/subdir
$ svn cp * ..
$ cd ..
$ svn rm subdir
$ svn ci -m"Copy parentdir/subdir/* into parentdir, remove subdir"

Upvotes: 4

Related Questions