How to add content to an SVN directory without checking out its contents?
Today I needed to add two Android projects to our Subversion repository but I had a problem. The directory in the repository already contained a lot of projects and I didn't want to checkout all of them. Is it possible add two directories to that directory without checking开发者_如何学Go out everything?
You can simply import
the new stuff right into the repository without any working copy:
svn import INSTALL.txt $SVN_REPO/trunk/proj1/INSTALL.txt
Works with directories (aka. "projects") also.
svn import proj2 $SVN_REPO/trunk/proj2
After importing you must checkout the stuff in order to continue your work:
rm -rf proj2/*
svn co $SVN_REPO/trunk/proj2 proj2
You can checkout a directory without getting any of its content thus:
svn co --depth empty SVN_URL
You can then move your projects into your working copy, then svn add
, and svn ci
.
No, but it's possible to check out only the topmost children of a given directory:
svn co --depth immediates REPOSITORY_URL
You can then work your way down the tree, checking out another layer at a time
cd SUBDIR
svn update --set-depth immediates
Or, you can check out an entire tree from one subdirectory
cd SUBDIR
svn update --set-depth infinity
精彩评论