git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v2 2/4] Recommend use of structure options for git svn.

From
Sebastian Leske <sebastian.leske@sleske.name>
Date
Nov 30, 2012, 07:16 UTC
Message-ID
<5cb2f71bc9be3323e425205020105dcfd948fca5.1354324110.git.Sebastian.Leske@sleske.name>
In-Reply-To
<cover.1354324110.git.Sebastian.Leske@sleske.name>

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 <sebastian.leske@sleske.name>
---
 Documentation/git-svn.txt |   24 +++++++++++++++++++++---
 1 file changed, 21 insertions(+), 3 deletions(-)
diff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt
index 824bf82..bfa8788 100644
--- a/Documentation/git-svn.txt
+++ b/Documentation/git-svn.txt
@@ -739,7 +739,8 @@ for rewriteRoot and rewriteUUID which can be used together.
 BASIC EXAMPLES
 --------------
 
-Tracking and contributing to the trunk of a Subversion-managed project:
+Tracking and contributing to the trunk of a Subversion-managed project
+(ignoring tags and branches):
 
 ------------------------------------------------------------------------
 # Clone a repo (like git clone):
@@ -764,8 +765,10 @@ Tracking and contributing to an entire Subversion-managed project
 (complete with a trunk, tags and branches):
 
 ------------------------------------------------------------------------
-# Clone a repo (like git clone):
-	git svn clone http://svn.example.com/project -T trunk -b branches -t tags
+# Clone a repo with standard SVN directory layout (like git clone):
+	git svn clone http://svn.example.com/project --stdlayout
+# Or, if the repo uses a non-standard directory layout:
+	git svn clone http://svn.example.com/project -T tr -b branch -t tag
 # View all branches and tags you have cloned:
 	git branch -r
 # Create a new branch in SVN
@@ -871,6 +874,21 @@ already dcommitted.  It is considered bad practice to --amend commits
 you've already pushed to a remote repository for other users, and
 dcommit with SVN is analogous to that.
 
+When cloning an SVN repository, if none of the options for describing
+the repository layout is used (--trunk, --tags, --branches,
+--stdlayout), 'git svn clone' will create a git repository with
+completely linear history, where branches and tags appear as separate
+folders in the working copy.  While this is the easiest way to get a
+copy of a complete repository, for projects with many branches it will
+lead to a working copy many times larger than just the trunk. Thus for
+projects using the standard directory structure (trunk/branches/tags),
+it is recommended to clone with option '--stdlayout'. If the project
+uses a non-standard structure, and/or if branches and tags are not
+required, it is easiest to only clone one directory (typically trunk),
+without giving any repository layout options.  If the full history with
+branches and tags is required, the options '--trunk' / '--branches' /
+'--tags' must be used.
+
 When using multiple --branches or --tags, 'git svn' does not automatically
 handle name collisions (for example, if two branches from different paths have
 the same name, or if a branch and a tag have the same name).  In these cases,
-- 
1.7.10.4
Previous: Junio C HamanoNext: Junio C Hamano
Message 4 of 10 in “git-svn: More docs for branch handling in”
  1. 0/4 git-svn: More docs for branch handling inSebastian Leske, Dec 1, 2012
  2. 1/4 git-svn: Document branches with at-sign(@).Sebastian Leske, Nov 30, 2012
  3. Junio C HamanoDec 3, 2012
  4. 2/4 Recommend use of structure options for git svn.Sebastian Leske, Nov 30, 2012
  5. Junio C HamanoDec 3, 2012
  6. 4/4 git-svn: Note about tags.Sebastian Leske, Nov 30, 2012
  7. 3/4 git-svn: Expand documentation for --follow-parentSebastian Leske, Nov 30, 2012
  8. Junio C HamanoDec 3, 2012
  9. Junio C HamanoDec 3, 2012
  10. Eric WongDec 4, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.