R
R
roman99662016-01-21 14:44:42
git
roman9966, 2016-01-21 14:44:42

How to remove NOT empty directories from a remote svn repository via git-svn?

And also add directories to gitignor or swignor so that they are ignored during the next commits.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alex, 2016-01-29
@roman9966

What's stopping you from removing them using svn itself? Or am I missing something?

# cd /home/toster/master/
# svn co http://svn.example.net/repos/toster/ ./
Checked out revision 0.

# svn add . --force
A         awk
A         awk/gettime.awk
A         awk/join.awk
...
A         authconfig/authconfig.py
A         aclocal
A         aclocal/pkg.m4

# svn commit -m 'Initial commit'
...
...
...
Transmitting file data ................................
Committed revision 1.

# svn commit -m 'Add some pictures'
...
...
...
Transmitting file data ................................
Committed revision 2.

# svn ls http://svn.example.net/repos/toster/
aclocal/
anaconda/
applications/
augeas/
authconfig/
awk/
firstboot-left.png
firstboot-small.png
splash-small.png
workstation.png


# cd /home/toster/slave/
# svn co http://svn.example.net/repos/toster/ ./
...
Checked out revision 2.

# mkdir xxx
# dd if=/dev/urandom of=xxx/100mb.bin bs=1M count=100
# svn add xxx
A         xxx
A  (bin)  xxx/100mb.bin

# svn commit -m "My private and secret data"
Adding         xxx
Adding  (bin)  xxx/100mb.bin
Transmitting file data .
Committed revision 3.

# cd /home/toster/master/
# svn update
Updating '.':
A    xxx
A    xxx/100mb.bin
Updated to revision 3.

# ls -la xxx/
total 102408
drwxr-xr-x  2 root root      4096 Jan 28 21:03 .
drwxr-xr-x 10 root root      4096 Jan 28 21:03 ..
-rw-r--r--  1 root root 104857600 Jan 28 21:03 100mb.bin


# cd /home/toster/slave/
# svn rm xxx/
D         xxx
D         xxx/100mb.bin

# svn commit -m "Remove my private and secret data"
Deleting       xxx

Committed revision 4.

# cd /home/toster/master/
# svn update
Updating '.':
D    xxx
Updated to revision 4.

# ls -la xxx
ls: cannot access xxx: No such file or directory

# svn ls http://svn.example.net/repos/toster/
aclocal/
anaconda/
applications/
augeas/
authconfig/
awk/
firstboot-left.png
firstboot-small.png
splash-small.png
workstation.png

The only negative is that this data will forever remain in the repository and will take up space. Just for such cases (node, bower, gulp) I wrote svn hook (pre-commit) on a server that simply did not accept such commits.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question