I am running a local git repository and want to clone the remote SVN trunk. This works fine but the trunk/ part of the folder is left off. The remote repository is too large to just clone or fetch the whole thing with branches etc.
I need the path correct for our code review tool.
How can I do a git-svn that only clones a certain trunk/branch but keeps the path intact?
/trunk/folders
/branch/folders
Selecting the Trun开发者_开发问答k option has the local path of
folders
I need it to be
trunk/folders
The way I have been doing this is
svn init -T svn://path/to/trunk
svn git fetch
I have also been using the -r option to git fetch to avoid fetching history from all eternity. You can also add back in branches/tags in to .git/config, this is documented in the git-svn manpage.
- (Not sure about this but it's the easiest solution) You could just move the directory folders into a new folder trunk. Git won't mind and other tools will find the path you want.
- You could do a
git svn init svn://path/trunk trunk
- Also check the
--ignore-patch
option ofgit svn fetch
精彩评论