git-sh-setup.sh: add variable to use the stuck-long mode
[gitweb.git] / Documentation / git-svn.txt
index 5383496cbb56864df3bb95a2ebbca563b520f27b..30c5ee256463eca3f38cb5a62191ed194304d35b 100644 (file)
@@ -79,8 +79,21 @@ COMMANDS
        trailing slash, so be sure you include one in the
        argument if that is what you want.  If --branches/-b is
        specified, the prefix must include a trailing slash.
-       Setting a prefix is useful if you wish to track multiple
-       projects that share a common repository.
+       Setting a prefix (with a trailing slash) is strongly
+       encouraged in any case, as your SVN-tracking refs will
+       then be located at "refs/remotes/$prefix/*", which is
+       compatible with Git's own remote-tracking ref layout
+       (refs/remotes/$remote/*). Setting a prefix is also useful
+       if you wish to track multiple projects that share a common
+       repository.
++
+NOTE: In Git v2.0, the default prefix will CHANGE from "" (no prefix)
+to "origin/". This is done to put SVN-tracking refs at
+"refs/remotes/origin/*" instead of "refs/remotes/*", and make them
+more compatible with how Git's own remote-tracking refs are organized
+(i.e. refs/remotes/$remote/*). You can enjoy the same benefits today,
+by using the --prefix option.
+
 --ignore-paths=<regex>;;
        When passed to 'init' or 'clone' this regular expression will
        be preserved as a config key.  See 'fetch' for a description
@@ -111,15 +124,15 @@ This automatically updates the rev_map if needed (see
 '$GIT_DIR/svn/\*\*/.rev_map.*' in the FILES section below for details).
 
 --localtime;;
-       Store Git commit times in the local timezone instead of UTC.  This
+       Store Git commit times in the local time zone instead of UTC.  This
        makes 'git log' (even without --date=local) show the same times
-       that `svn log` would in the local timezone.
+       that `svn log` would in the local time zone.
 +
 This doesn't interfere with interoperating with the Subversion
 repository you cloned from, but if you wish for your local Git
 repository to be able to interoperate with someone else's local Git
 repository, either don't use this option or you should both use it in
-the same local timezone.
+the same local time zone.
 
 --parent;;
        Fetch only from the SVN parent of the current HEAD.
@@ -162,11 +175,11 @@ Skip "branches" and "tags" of first level directories;;
        precedence over '--include-paths'.
 
 --log-window-size=<n>;;
-    Fetch <n> log entries per request when scanning Subversion history.
-    The default is 100. For very large Subversion repositories, larger
-    values may be needed for 'clone'/'fetch' to complete in reasonable
-    time. But overly large values may lead to higher memory usage and
-    request timeouts.
+       Fetch <n> log entries per request when scanning Subversion history.
+       The default is 100. For very large Subversion repositories, larger
+       values may be needed for 'clone'/'fetch' to complete in reasonable
+       time. But overly large values may lead to higher memory usage and
+       request timeouts.
 
 'clone'::
        Runs 'init' and 'fetch'.  It will automatically create a
@@ -262,7 +275,7 @@ first have already been pushed into SVN.
        For each patch, one may answer "yes" (accept this patch), "no" (discard this
        patch), "all" (accept all patches), or "quit".
        +
-       'git svn dcommit' returns immediately if answer is "no" or "quit", without
+       'git svn dcommit' returns immediately if answer is "no" or "quit", without
        committing anything to SVN.
 
 'branch'::
@@ -353,12 +366,12 @@ environment). This command has the same behaviour.
 Any other arguments are passed directly to 'git log'
 
 'blame'::
-       Show what revision and author last modified each line of a file. The
-       output of this mode is format-compatible with the output of
-       `svn blame' by default. Like the SVN blame command,
-       local uncommitted changes in the working tree are ignored;
-       the version of the file in the HEAD revision is annotated. Unknown
-       arguments are passed directly to 'git blame'.
+       Show what revision and author last modified each line of a file. The
+       output of this mode is format-compatible with the output of
+       `svn blame' by default. Like the SVN blame command,
+       local uncommitted changes in the working tree are ignored;
+       the version of the file in the HEAD revision is annotated. Unknown
+       arguments are passed directly to 'git blame'.
 +
 --git-format;;
        Produce output in the same format as 'git blame', but with
@@ -811,16 +824,16 @@ Tracking and contributing to an entire Subversion-managed project
 
 ------------------------------------------------------------------------
 # Clone a repo with standard SVN directory layout (like git clone):
-       git svn clone http://svn.example.com/project --stdlayout
+       git svn clone http://svn.example.com/project --stdlayout --prefix svn/
 # Or, if the repo uses a non-standard directory layout:
-       git svn clone http://svn.example.com/project -T tr -b branch -t tag
+       git svn clone http://svn.example.com/project -T tr -b branch -t tag --prefix svn/
 # View all branches and tags you have cloned:
        git branch -r
 # Create a new branch in SVN
-    git svn branch waldo
+       git svn branch waldo
 # Reset your master to trunk (or any other branch, replacing 'trunk'
 # with the appropriate name):
-       git reset --hard remotes/trunk
+       git reset --hard svn/trunk
 # You may only dcommit to one branch/tag/trunk at a time.  The usage
 # of dcommit/rebase/show-ignore should be the same as above.
 ------------------------------------------------------------------------
@@ -834,7 +847,7 @@ have each person clone that repository with 'git clone':
 
 ------------------------------------------------------------------------
 # Do the initial import on a server
-       ssh server "cd /pub && git svn clone http://svn.example.com/project
+       ssh server "cd /pub && git svn clone http://svn.example.com/project [options...]"
 # Clone locally - make sure the refs/remotes/ space matches the server
        mkdir project
        cd project
@@ -847,8 +860,9 @@ have each person clone that repository with 'git clone':
        git config --remove-section remote.origin
 # Create a local branch from one of the branches just fetched
        git checkout -b master FETCH_HEAD
-# Initialize 'git svn' locally (be sure to use the same URL and -T/-b/-t options as were used on server)
-       git svn init http://svn.example.com/project
+# Initialize 'git svn' locally (be sure to use the same URL and
+# --stdlayout/-T/-b/-t/--prefix options as were used on server)
+       git svn init http://svn.example.com/project [options...]
 # Pull the latest changes from Subversion
        git svn rebase
 ------------------------------------------------------------------------
@@ -980,6 +994,16 @@ 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 the options for describing the repository layout (--trunk,
+--tags, --branches, --stdlayout), please also specify the --prefix
+option (e.g. '--prefix=origin/') to cause your SVN-tracking refs to be
+placed at refs/remotes/origin/* rather than the default refs/remotes/*.
+The former is more compatible with the layout of Git's "regular"
+remote-tracking refs (refs/remotes/$remote/*), and may potentially
+prevent similarly named SVN branches and Git remotes from clobbering
+each other. In Git v2.0 the default prefix used (i.e. when no --prefix
+is given) will change from "" (no prefix) to "origin/".
+
 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,
@@ -1042,8 +1066,8 @@ comma-separated list of names within braces. For example:
 [svn-remote "huge-project"]
        url = http://server.org/svn
        fetch = trunk/src:refs/remotes/trunk
-       branches = branches/{red,green}/src:refs/remotes/branches/*
-       tags = tags/{1.0,2.0}/src:refs/remotes/tags/*
+       branches = branches/{red,green}/src:refs/remotes/project-a/branches/*
+       tags = tags/{1.0,2.0}/src:refs/remotes/project-a/tags/*
 ------------------------------------------------------------------------
 
 Multiple fetch, branches, and tags keys are supported: