Code

Merge branch 'maint'
[git.git] / Documentation / git-svn.txt
index e7c0f1c959d39739e177096875dd8aac5fd185d9..84c8f3cde0b781ef1579b38a17430dc405115190 100644 (file)
@@ -12,18 +12,18 @@ SYNOPSIS
 DESCRIPTION
 -----------
 'git-svn' is a simple conduit for changesets between Subversion and git.
-It is not to be confused with linkgit:git-svnimport[1], which is
-read-only.
+It provides a bidirectional flow of changes between a Subversion and a git
+repository.
 
-'git-svn' was originally designed for an individual developer who wants a
-bidirectional flow of changesets between a single branch in Subversion
-and an arbitrary number of branches in git.  Since its inception,
-'git-svn' has gained the ability to track multiple branches in a manner
-similar to 'git-svnimport'.
+'git-svn' can track a single Subversion branch simply by using a
+URL to the branch, follow branches laid out in the Subversion recommended
+method (trunk, branches, tags directories) with the --stdlayout option, or
+follow branches in any layout with the -T/-t/-b options (see options to
+'init' below, and also the 'clone' command).
 
-'git-svn' is especially useful when it comes to tracking repositories
-not organized in the way Subversion developers recommend (trunk,
-branches, tags directories).
+Once tracking a Subversion branch (with any of the above methods), the git
+repository can be updated from Subversion by the 'fetch' command and
+Subversion updated from git by the 'dcommit' command.
 
 COMMANDS
 --------
@@ -138,8 +138,33 @@ and have no uncommitted changes.
 +
 --no-rebase;;
        After committing, do not rebase or reset.
+--commit-url <URL>;;
+       Commit to this SVN URL (the full path).  This is intended to
+       allow existing git-svn repositories created with one transport
+       method (e.g. `svn://` or `http://` for anonymous read) to be
+       reused if a user is later given access to an alternate transport
+       method (e.g. `svn+ssh://` or `https://`) for commit.
+
+       Using this option for any other purpose (don't ask)
+       is very strongly discouraged.
 --
 
+'branch'::
+       Create a branch in the SVN repository.
+
+-m;;
+--message;;
+       Allows to specify the commit message.
+
+-t;;
+--tag;;
+       Create a tag by using the tags_subdir instead of the branches_subdir
+       specified during git svn init.
+
+'tag'::
+       Create a tag in the SVN repository. This is a shorthand for
+       'branch -t'.
+
 'log'::
        This should make it easy to look up svn log messages when svn
        users refer to -r/--revision numbers.
@@ -209,7 +234,7 @@ Any other arguments are passed directly to 'git-log'
        Recursively finds the svn:ignore property on directories and
        creates matching .gitignore files. The resulting files are staged to
        be committed, but are not committed. Use -r/--revision to refer to a
-       specfic revision.
+       specific revision.
 
 'show-ignore'::
        Recursively finds and lists the svn:ignore property on
@@ -218,8 +243,7 @@ Any other arguments are passed directly to 'git-log'
 
 'commit-diff'::
        Commits the diff of two tree-ish arguments from the
-       command-line.  This command is intended for interoperability with
-       'git-svnimport' and does not rely on being inside an `git-svn
+       command-line.  This command does not rely on being inside an `git-svn
        init`-ed repository.  This command takes three arguments, (a) the
        original tree to diff against, (b) the new tree result, (c) the
        URL of the target Subversion repository.  The final argument
@@ -317,8 +341,7 @@ config key: svn.findcopiesharder
 -A<filename>::
 --authors-file=<filename>::
 
-Syntax is compatible with the files used by 'git-svnimport' and
-'git-cvsimport':
+Syntax is compatible with the file used by 'git-cvsimport':
 
 ------------------------------------------------------------------------
        loginname = Joe User <user@example.com>
@@ -365,7 +388,8 @@ Passed directly to 'git-rebase' when using 'dcommit' if a
 -n::
 --dry-run::
 
-This can be used with the 'dcommit' and 'rebase' commands.
+This can be used with the 'dcommit', 'rebase', 'branch' and 'tag'
+commands.
 
 For 'dcommit', print out the series of git arguments that would show
 which diffs would be committed to SVN.
@@ -374,6 +398,9 @@ For 'rebase', display the local branch associated with the upstream svn
 repository associated with the current branch and the URL of svn
 repository that will be fetched from.
 
+For 'branch' and 'tag', display the urls that will be used for copying when
+creating the branch or tag.
+
 --
 
 ADVANCED OPTIONS
@@ -466,7 +493,7 @@ Tracking and contributing to the trunk of a Subversion-managed project:
 
 ------------------------------------------------------------------------
 # Clone a repo (like git clone):
-       git svn clone http://svn.foo.org/project/trunk
+       git svn clone http://svn.example.com/project/trunk
 # Enter the newly cloned directory:
        cd trunk
 # You should be on master branch, double-check with git-branch
@@ -488,9 +515,11 @@ Tracking and contributing to an entire Subversion-managed project
 
 ------------------------------------------------------------------------
 # Clone a repo (like git clone):
-       git svn clone http://svn.foo.org/project -T trunk -b branches -t tags
+       git svn clone http://svn.example.com/project -T trunk -b branches -t tags
 # View all branches and tags you have cloned:
        git branch -r
+# Create a new branch in SVN
+    git svn branch waldo
 # Reset your master to trunk (or any other branch, replacing 'trunk'
 # with the appropriate name):
        git reset --hard remotes/trunk
@@ -507,7 +536,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.foo.org/project
+       ssh server "cd /pub && git svn clone http://svn.example.com/project
 # Clone locally - make sure the refs/remotes/ space matches the server
        mkdir project
        cd project
@@ -516,7 +545,7 @@ have each person clone that repository with 'git-clone':
        git config --add remote.origin.fetch '+refs/remotes/*:refs/remotes/*'
        git fetch
 # 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.foo.org/project
+       git svn init http://svn.example.com/project
 # Pull the latest changes from Subversion
        git svn rebase
 ------------------------------------------------------------------------