Am trying to do a git-svn clone to import all the files in SVN to GIT. The command that was given was this;
git svn clone --stdlayout --ignore-paths='(/cache|/tmps|/file/conf/setting.xml)' --authors-file=../authors.txt file:///svnFolder/local-repos/PRG PRG.git
The above clones but the issue is it ignores all the files and folder that has cache and tmps. Like for instance it ignores even these
new/folder/cache
meta/files/sets/tmps.html
Can anybody please help me out to set the regular expression to give in the ignore-paths to ignore files and subdirectories that is there in the root folder's cache and tmps directories.
Your ignore paths regex is too general. The regular expression provided is run on a full path. For example, if your repository layout is:
svn_root/path/to/your_project
And then has a standard layout of trunk, branches, and tags, a set of sample path lines that gets evaluated might be:
svn_root/path/to/your_project/trunk/new/folder/cache
svn_root/path/to/your_project/trunk/meta/files/sets/tmps.html
svn_root/path/to/your_project/trunk/file/conf/setting.xml
svn_root/path/to/your_project/trunk/cache/...
svn_root/path/to/your_project/trunk/tmps/...
Lets start by analyzing the regex you provided as part of the ignore-paths parameter:
'(/cache|/tmps|/file/conf/setting.xml)'
With your regular expression analyzed, lets walk through the sample paths given above with your expressions:
String to evaluate:
svn_root/path/to/your_project/trunk/new/folder/cache
String to evaluate:
svn_root/path/to/your_project/trunk/meta/files/sets/tmps.html
String to evaluate:
svn_root/path/to/your_project/trunk/file/conf/setting.xml
From here, you can probably see why the following two are also ignored. One of the sub expressions matches a portion of each path:
svn_root/path/to/your_project/trunk/cache/...
svn_root/path/to/your_project/trunk/tmps/...
There are several ways to solve this problem, but if you are only trying to ignore a couple of specific directories in the trunk, you could modify your expression as follows:
'(trunk/cache|trunk/tmps|/file/conf/setting\.xml)'
It really depends on what you want to do, which specific paths you want to ignore. If you need more help, if you could clarify in detail as to how your repository is laid out and which directories are to be ignored.