Skip to content

Commit 91583a6

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 d658835 commit 91583a6

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
@@ -732,7 +732,8 @@ for rewriteRoot and rewriteUUID which can be used together.
732732
BASIC EXAMPLES
733733
--------------
734734

735-
Tracking and contributing to the trunk of a Subversion-managed project:
735+
Tracking and contributing to the trunk of a Subversion-managed project
736+
(ignoring tags and branches):
736737

737738
------------------------------------------------------------------------
738739
# Clone a repo (like git clone):
@@ -757,8 +758,10 @@ Tracking and contributing to an entire Subversion-managed project
757758
(complete with a trunk, tags and branches):
758759

759760
------------------------------------------------------------------------
760-
# Clone a repo (like git clone):
761-
git svn clone http://svn.example.com/project -T trunk -b branches -t tags
761+
# Clone a repo with standard SVN directory layout (like git clone):
762+
git svn clone http://svn.example.com/project --stdlayout
763+
# Or, if the repo uses a non-standard directory layout:
764+
git svn clone http://svn.example.com/project -T tr -b branch -t tag
762765
# View all branches and tags you have cloned:
763766
git branch -r
764767
# Create a new branch in SVN
@@ -910,6 +913,21 @@ already dcommitted. It is considered bad practice to --amend commits
910913
you've already pushed to a remote repository for other users, and
911914
dcommit with SVN is analogous to that.
912915

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

0 commit comments

Comments
 (0)