Skip to content

Commit 92166fd

Browse files
sleskegitster
authored andcommitted
git-svn: Recommend use of structure options.
Document that when using git svn, one should usually either use the directory structure options to import branches as branches, or only import one subdirectory. The default behaviour of cloning all branches and tags as subdirectories in the working copy is usually not what the user wants. Signed-off-by: Sebastian Leske <[email protected]> Acked-by: Eric Wong <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 7cad29d commit 92166fd

File tree

1 file changed

+21
-3
lines changed

1 file changed

+21
-3
lines changed

Documentation/git-svn.txt

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,8 @@ for rewriteRoot and rewriteUUID which can be used together.
739739
BASIC EXAMPLES
740740
--------------
741741

742-
Tracking and contributing to the trunk of a Subversion-managed project:
742+
Tracking and contributing to the trunk of a Subversion-managed project
743+
(ignoring tags and branches):
743744

744745
------------------------------------------------------------------------
745746
# Clone a repo (like git clone):
@@ -764,8 +765,10 @@ Tracking and contributing to an entire Subversion-managed project
764765
(complete with a trunk, tags and branches):
765766

766767
------------------------------------------------------------------------
767-
# Clone a repo (like git clone):
768-
git svn clone http://svn.example.com/project -T trunk -b branches -t tags
768+
# Clone a repo with standard SVN directory layout (like git clone):
769+
git svn clone http://svn.example.com/project --stdlayout
770+
# Or, if the repo uses a non-standard directory layout:
771+
git svn clone http://svn.example.com/project -T tr -b branch -t tag
769772
# View all branches and tags you have cloned:
770773
git branch -r
771774
# Create a new branch in SVN
@@ -917,6 +920,21 @@ already dcommitted. It is considered bad practice to --amend commits
917920
you've already pushed to a remote repository for other users, and
918921
dcommit with SVN is analogous to that.
919922

923+
When cloning an SVN repository, if none of the options for describing
924+
the repository layout is used (--trunk, --tags, --branches,
925+
--stdlayout), 'git svn clone' will create a git repository with
926+
completely linear history, where branches and tags appear as separate
927+
directories in the working copy. While this is the easiest way to get a
928+
copy of a complete repository, for projects with many branches it will
929+
lead to a working copy many times larger than just the trunk. Thus for
930+
projects using the standard directory structure (trunk/branches/tags),
931+
it is recommended to clone with option '--stdlayout'. If the project
932+
uses a non-standard structure, and/or if branches and tags are not
933+
required, it is easiest to only clone one directory (typically trunk),
934+
without giving any repository layout options. If the full history with
935+
branches and tags is required, the options '--trunk' / '--branches' /
936+
'--tags' must be used.
937+
920938
When using multiple --branches or --tags, 'git svn' does not automatically
921939
handle name collisions (for example, if two branches from different paths have
922940
the same name, or if a branch and a tag have the same name). In these cases,

0 commit comments

Comments
 (0)