Documentation / git-svn.txton commit Merge branch 'ne/maint-1.6.0-diff-tree-t-r-show-directory' (4197195)
   1git-svn(1)
   2==========
   3
   4NAME
   5----
   6git-svn - Bidirectional operation between a Subversion repository and git
   7
   8SYNOPSIS
   9--------
  10'git svn' <command> [options] [arguments]
  11
  12DESCRIPTION
  13-----------
  14'git-svn' is a simple conduit for changesets between Subversion and git.
  15It provides a bidirectional flow of changes between a Subversion and a git
  16repository.
  17
  18'git-svn' can track a standard Subversion repository,
  19following the common "trunk/branches/tags" layout, with the --stdlayout option.
  20It can also follow branches and tags in any layout with the -T/-t/-b options
  21(see options to 'init' below, and also the 'clone' command).
  22
  23Once tracking a Subversion repository (with any of the above methods), the git
  24repository can be updated from Subversion by the 'fetch' command and
  25Subversion updated from git by the 'dcommit' command.
  26
  27COMMANDS
  28--------
  29--
  30
  31'init'::
  32        Initializes an empty git repository with additional
  33        metadata directories for 'git-svn'.  The Subversion URL
  34        may be specified as a command-line argument, or as full
  35        URL arguments to -T/-t/-b.  Optionally, the target
  36        directory to operate on can be specified as a second
  37        argument.  Normally this command initializes the current
  38        directory.
  39
  40-T<trunk_subdir>;;
  41--trunk=<trunk_subdir>;;
  42-t<tags_subdir>;;
  43--tags=<tags_subdir>;;
  44-b<branches_subdir>;;
  45--branches=<branches_subdir>;;
  46-s;;
  47--stdlayout;;
  48        These are optional command-line options for init.  Each of
  49        these flags can point to a relative repository path
  50        (--tags=project/tags) or a full url
  51        (--tags=https://foo.org/project/tags).
  52        You can specify more than one --tags and/or --branches options, in case
  53        your Subversion repository places tags or branches under multiple paths.
  54        The option --stdlayout is
  55        a shorthand way of setting trunk,tags,branches as the relative paths,
  56        which is the Subversion default. If any of the other options are given
  57        as well, they take precedence.
  58--no-metadata;;
  59        Set the 'noMetadata' option in the [svn-remote] config.
  60--use-svm-props;;
  61        Set the 'useSvmProps' option in the [svn-remote] config.
  62--use-svnsync-props;;
  63        Set the 'useSvnsyncProps' option in the [svn-remote] config.
  64--rewrite-root=<URL>;;
  65        Set the 'rewriteRoot' option in the [svn-remote] config.
  66--use-log-author;;
  67        When retrieving svn commits into git (as part of fetch, rebase, or
  68        dcommit operations), look for the first From: or Signed-off-by: line
  69        in the log message and use that as the author string.
  70--add-author-from;;
  71        When committing to svn from git (as part of commit or dcommit
  72        operations), if the existing log message doesn't already have a
  73        From: or Signed-off-by: line, append a From: line based on the
  74        git commit's author string.  If you use this, then --use-log-author
  75        will retrieve a valid author string for all commits.
  76--username=<USER>;;
  77        For transports that SVN handles authentication for (http,
  78        https, and plain svn), specify the username.  For other
  79        transports (eg svn+ssh://), you must include the username in
  80        the URL, eg svn+ssh://foo@svn.bar.com/project
  81--prefix=<prefix>;;
  82        This allows one to specify a prefix which is prepended
  83        to the names of remotes if trunk/branches/tags are
  84        specified.  The prefix does not automatically include a
  85        trailing slash, so be sure you include one in the
  86        argument if that is what you want.  If --branches/-b is
  87        specified, the prefix must include a trailing slash.
  88        Setting a prefix is useful if you wish to track multiple
  89        projects that share a common repository.
  90--ignore-paths=<regex>;;
  91        When passed to 'init' or 'clone' this regular expression will
  92        be preserved as a config key.  See 'fetch' for a description
  93        of '--ignore-paths'.
  94
  95'fetch'::
  96        Fetch unfetched revisions from the Subversion remote we are
  97        tracking.  The name of the [svn-remote "..."] section in the
  98        .git/config file may be specified as an optional command-line
  99        argument.
 100
 101--localtime;;
 102        Store Git commit times in the local timezone instead of UTC.  This
 103        makes 'git-log' (even without --date=local) show the same times
 104        that `svn log` would in the local timezone.
 105
 106--parent;;
 107        Fetch only from the SVN parent of the current HEAD.
 108
 109This doesn't interfere with interoperating with the Subversion
 110repository you cloned from, but if you wish for your local Git
 111repository to be able to interoperate with someone else's local Git
 112repository, either don't use this option or you should both use it in
 113the same local timezone.
 114
 115--ignore-paths=<regex>;;
 116        This allows one to specify a Perl regular expression that will
 117        cause skipping of all matching paths from checkout from SVN.
 118        The '--ignore-paths' option should match for every 'fetch'
 119        (including automatic fetches due to 'clone', 'dcommit',
 120        'rebase', etc) on a given repository.
 121
 122config key: svn-remote.<name>.ignore-paths
 123
 124        If the ignore-paths config key is set and the command
 125        line option is also given, both regular expressions
 126        will be used.
 127
 128Examples:
 129
 130        --ignore-paths="^doc" - skip "doc*" directory for every
 131            fetch.
 132
 133        --ignore-paths="^[^/]+/(?:branches|tags)" - skip
 134            "branches" and "tags" of first level directories.
 135
 136'clone'::
 137        Runs 'init' and 'fetch'.  It will automatically create a
 138        directory based on the basename of the URL passed to it;
 139        or if a second argument is passed; it will create a directory
 140        and work within that.  It accepts all arguments that the
 141        'init' and 'fetch' commands accept; with the exception of
 142        '--fetch-all'.   After a repository is cloned, the 'fetch'
 143        command will be able to update revisions without affecting
 144        the working tree; and the 'rebase' command will be able
 145        to update the working tree with the latest changes.
 146
 147'rebase'::
 148        This fetches revisions from the SVN parent of the current HEAD
 149        and rebases the current (uncommitted to SVN) work against it.
 150
 151This works similarly to `svn update` or 'git-pull' except that
 152it preserves linear history with 'git-rebase' instead of
 153'git-merge' for ease of dcommitting with 'git-svn'.
 154
 155This accepts all options that 'git-svn fetch' and 'git-rebase'
 156accept.  However, '--fetch-all' only fetches from the current
 157[svn-remote], and not all [svn-remote] definitions.
 158
 159Like 'git-rebase'; this requires that the working tree be clean
 160and have no uncommitted changes.
 161
 162-l;;
 163--local;;
 164        Do not fetch remotely; only run 'git-rebase' against the
 165        last fetched commit from the upstream SVN.
 166
 167'dcommit'::
 168        Commit each diff from a specified head directly to the SVN
 169        repository, and then rebase or reset (depending on whether or
 170        not there is a diff between SVN and head).  This will create
 171        a revision in SVN for each commit in git.
 172        It is recommended that you run 'git-svn' fetch and rebase (not
 173        pull or merge) your commits against the latest changes in the
 174        SVN repository.
 175        An optional revision or branch argument may be specified, and
 176        causes 'git-svn' to do all work on that revision/branch
 177        instead of HEAD.
 178        This is advantageous over 'set-tree' (below) because it produces
 179        cleaner, more linear history.
 180+
 181--no-rebase;;
 182        After committing, do not rebase or reset.
 183--commit-url <URL>;;
 184        Commit to this SVN URL (the full path).  This is intended to
 185        allow existing git-svn repositories created with one transport
 186        method (e.g. `svn://` or `http://` for anonymous read) to be
 187        reused if a user is later given access to an alternate transport
 188        method (e.g. `svn+ssh://` or `https://`) for commit.
 189
 190config key: svn-remote.<name>.commiturl
 191
 192config key: svn.commiturl (overwrites all svn-remote.<name>.commiturl options)
 193
 194        Using this option for any other purpose (don't ask)
 195        is very strongly discouraged.
 196--
 197
 198'branch'::
 199        Create a branch in the SVN repository.
 200
 201-m;;
 202--message;;
 203        Allows to specify the commit message.
 204
 205-t;;
 206--tag;;
 207        Create a tag by using the tags_subdir instead of the branches_subdir
 208        specified during git svn init.
 209
 210-d;;
 211--destination;;
 212        If more than one --branches (or --tags) option was given to the 'init'
 213        or 'clone' command, you must provide the location of the branch (or
 214        tag) you wish to create in the SVN repository.  The value of this
 215        option must match one of the paths specified by a --branches (or
 216        --tags) option.  You can see these paths with the commands
 217+
 218        git config --get-all svn-remote.<name>.branches
 219        git config --get-all svn-remote.<name>.tags
 220+
 221where <name> is the name of the SVN repository as specified by the -R option to
 222'init' (or "svn" by default).
 223
 224'tag'::
 225        Create a tag in the SVN repository. This is a shorthand for
 226        'branch -t'.
 227
 228'log'::
 229        This should make it easy to look up svn log messages when svn
 230        users refer to -r/--revision numbers.
 231+
 232The following features from `svn log' are supported:
 233+
 234--
 235-r/--revision=<n>[:<n>];;
 236        is supported, non-numeric args are not:
 237        HEAD, NEXT, BASE, PREV, etc ...
 238-v/--verbose;;
 239        it's not completely compatible with the --verbose
 240        output in svn log, but reasonably close.
 241--limit=<n>;;
 242        is NOT the same as --max-count, doesn't count
 243        merged/excluded commits
 244--incremental;;
 245        supported
 246--
 247+
 248New features:
 249+
 250--
 251--show-commit;;
 252        shows the git commit sha1, as well
 253--oneline;;
 254        our version of --pretty=oneline
 255--
 256+
 257NOTE: SVN itself only stores times in UTC and nothing else. The regular svn
 258client converts the UTC time to the local time (or based on the TZ=
 259environment). This command has the same behaviour.
 260+
 261Any other arguments are passed directly to 'git-log'
 262
 263'blame'::
 264       Show what revision and author last modified each line of a file. The
 265       output of this mode is format-compatible with the output of
 266       `svn blame' by default. Like the SVN blame command,
 267       local uncommitted changes in the working copy are ignored;
 268       the version of the file in the HEAD revision is annotated. Unknown
 269       arguments are passed directly to 'git-blame'.
 270+
 271--git-format;;
 272        Produce output in the same format as 'git-blame', but with
 273        SVN revision numbers instead of git commit hashes. In this mode,
 274        changes that haven't been committed to SVN (including local
 275        working-copy edits) are shown as revision 0.
 276
 277--
 278'find-rev'::
 279        When given an SVN revision number of the form 'rN', returns the
 280        corresponding git commit hash (this can optionally be followed by a
 281        tree-ish to specify which branch should be searched).  When given a
 282        tree-ish, returns the corresponding SVN revision number.
 283
 284'set-tree'::
 285        You should consider using 'dcommit' instead of this command.
 286        Commit specified commit or tree objects to SVN.  This relies on
 287        your imported fetch data being up-to-date.  This makes
 288        absolutely no attempts to do patching when committing to SVN, it
 289        simply overwrites files with those specified in the tree or
 290        commit.  All merging is assumed to have taken place
 291        independently of 'git-svn' functions.
 292
 293'create-ignore'::
 294        Recursively finds the svn:ignore property on directories and
 295        creates matching .gitignore files. The resulting files are staged to
 296        be committed, but are not committed. Use -r/--revision to refer to a
 297        specific revision.
 298
 299'show-ignore'::
 300        Recursively finds and lists the svn:ignore property on
 301        directories.  The output is suitable for appending to
 302        the $GIT_DIR/info/exclude file.
 303
 304'commit-diff'::
 305        Commits the diff of two tree-ish arguments from the
 306        command-line.  This command does not rely on being inside an `git-svn
 307        init`-ed repository.  This command takes three arguments, (a) the
 308        original tree to diff against, (b) the new tree result, (c) the
 309        URL of the target Subversion repository.  The final argument
 310        (URL) may be omitted if you are working from a 'git-svn'-aware
 311        repository (that has been `init`-ed with 'git-svn').
 312        The -r<revision> option is required for this.
 313
 314'info'::
 315        Shows information about a file or directory similar to what
 316        `svn info' provides.  Does not currently support a -r/--revision
 317        argument.  Use the --url option to output only the value of the
 318        'URL:' field.
 319
 320'proplist'::
 321        Lists the properties stored in the Subversion repository about a
 322        given file or directory.  Use -r/--revision to refer to a specific
 323        Subversion revision.
 324
 325'propget'::
 326        Gets the Subversion property given as the first argument, for a
 327        file.  A specific revision can be specified with -r/--revision.
 328
 329'show-externals'::
 330        Shows the Subversion externals.  Use -r/--revision to specify a
 331        specific revision.
 332
 333'reset'::
 334        Undoes the effects of 'fetch' back to the specified revision.
 335        This allows you to re-'fetch' an SVN revision.  Normally the
 336        contents of an SVN revision should never change and 'reset'
 337        should not be necessary.  However, if SVN permissions change,
 338        or if you alter your --ignore-paths option, a 'fetch' may fail
 339        with "not found in commit" (file not previously visible) or
 340        "checksum mismatch" (missed a modification).  If the problem
 341        file cannot be ignored forever (with --ignore-paths) the only
 342        way to repair the repo is to use 'reset'.
 343
 344Only the rev_map and refs/remotes/git-svn are changed.  Follow 'reset'
 345with a 'fetch' and then 'git-reset' or 'git-rebase' to move local
 346branches onto the new tree.
 347
 348-r/--revision=<n>;;
 349        Specify the most recent revision to keep.  All later revisions
 350        are discarded.
 351-p/--parent;;
 352        Discard the specified revision as well, keeping the nearest
 353        parent instead.
 354Example:;;
 355Assume you have local changes in "master", but you need to refetch "r2".
 356
 357------------
 358    r1---r2---r3 remotes/git-svn
 359                \
 360                 A---B master
 361------------
 362
 363Fix the ignore-paths or SVN permissions problem that caused "r2" to
 364be incomplete in the first place.  Then:
 365
 366[verse]
 367git svn reset -r2 -p
 368git svn fetch
 369
 370------------
 371    r1---r2'--r3' remotes/git-svn
 372      \
 373       r2---r3---A---B master
 374------------
 375
 376Then fixup "master" with 'git-rebase'.
 377Do NOT use 'git-merge' or your history will not be compatible with a
 378future 'dcommit'!
 379
 380[verse]
 381git rebase --onto remotes/git-svn A^ master
 382
 383------------
 384    r1---r2'--r3' remotes/git-svn
 385                \
 386                 A'--B' master
 387------------
 388
 389
 390--
 391
 392OPTIONS
 393-------
 394--
 395
 396--shared[={false|true|umask|group|all|world|everybody}]::
 397--template=<template_directory>::
 398        Only used with the 'init' command.
 399        These are passed directly to 'git-init'.
 400
 401-r <ARG>::
 402--revision <ARG>::
 403
 404Used with the 'fetch' command.
 405
 406This allows revision ranges for partial/cauterized history
 407to be supported.  $NUMBER, $NUMBER1:$NUMBER2 (numeric ranges),
 408$NUMBER:HEAD, and BASE:$NUMBER are all supported.
 409
 410This can allow you to make partial mirrors when running fetch;
 411but is generally not recommended because history will be skipped
 412and lost.
 413
 414-::
 415--stdin::
 416
 417Only used with the 'set-tree' command.
 418
 419Read a list of commits from stdin and commit them in reverse
 420order.  Only the leading sha1 is read from each line, so
 421'git-rev-list --pretty=oneline' output can be used.
 422
 423--rmdir::
 424
 425Only used with the 'dcommit', 'set-tree' and 'commit-diff' commands.
 426
 427Remove directories from the SVN tree if there are no files left
 428behind.  SVN can version empty directories, and they are not
 429removed by default if there are no files left in them.  git
 430cannot version empty directories.  Enabling this flag will make
 431the commit to SVN act like git.
 432
 433config key: svn.rmdir
 434
 435-e::
 436--edit::
 437
 438Only used with the 'dcommit', 'set-tree' and 'commit-diff' commands.
 439
 440Edit the commit message before committing to SVN.  This is off by
 441default for objects that are commits, and forced on when committing
 442tree objects.
 443
 444config key: svn.edit
 445
 446-l<num>::
 447--find-copies-harder::
 448
 449Only used with the 'dcommit', 'set-tree' and 'commit-diff' commands.
 450
 451They are both passed directly to 'git-diff-tree'; see
 452linkgit:git-diff-tree[1] for more information.
 453
 454[verse]
 455config key: svn.l
 456config key: svn.findcopiesharder
 457
 458-A<filename>::
 459--authors-file=<filename>::
 460
 461Syntax is compatible with the file used by 'git-cvsimport':
 462
 463------------------------------------------------------------------------
 464        loginname = Joe User <user@example.com>
 465------------------------------------------------------------------------
 466
 467If this option is specified and 'git-svn' encounters an SVN
 468committer name that does not exist in the authors-file, 'git-svn'
 469will abort operation. The user will then have to add the
 470appropriate entry.  Re-running the previous 'git-svn' command
 471after the authors-file is modified should continue operation.
 472
 473config key: svn.authorsfile
 474
 475--authors-prog=<filename>::
 476
 477If this option is specified, for each SVN committer name that does not
 478exist in the authors file, the given file is executed with the committer
 479name as the first argument.  The program is expected to return a single
 480line of the form "Name <email>", which will be treated as if included in
 481the authors file.
 482
 483-q::
 484--quiet::
 485        Make 'git-svn' less verbose. Specify a second time to make it
 486        even less verbose.
 487
 488--repack[=<n>]::
 489--repack-flags=<flags>::
 490
 491These should help keep disk usage sane for large fetches
 492with many revisions.
 493
 494--repack takes an optional argument for the number of revisions
 495to fetch before repacking.  This defaults to repacking every
 4961000 commits fetched if no argument is specified.
 497
 498--repack-flags are passed directly to 'git-repack'.
 499
 500[verse]
 501config key: svn.repack
 502config key: svn.repackflags
 503
 504-m::
 505--merge::
 506-s<strategy>::
 507--strategy=<strategy>::
 508
 509These are only used with the 'dcommit' and 'rebase' commands.
 510
 511Passed directly to 'git-rebase' when using 'dcommit' if a
 512'git-reset' cannot be used (see 'dcommit').
 513
 514-n::
 515--dry-run::
 516
 517This can be used with the 'dcommit', 'rebase', 'branch' and 'tag'
 518commands.
 519
 520For 'dcommit', print out the series of git arguments that would show
 521which diffs would be committed to SVN.
 522
 523For 'rebase', display the local branch associated with the upstream svn
 524repository associated with the current branch and the URL of svn
 525repository that will be fetched from.
 526
 527For 'branch' and 'tag', display the urls that will be used for copying when
 528creating the branch or tag.
 529
 530--
 531
 532ADVANCED OPTIONS
 533----------------
 534--
 535
 536-i<GIT_SVN_ID>::
 537--id <GIT_SVN_ID>::
 538
 539This sets GIT_SVN_ID (instead of using the environment).  This
 540allows the user to override the default refname to fetch from
 541when tracking a single URL.  The 'log' and 'dcommit' commands
 542no longer require this switch as an argument.
 543
 544-R<remote name>::
 545--svn-remote <remote name>::
 546        Specify the [svn-remote "<remote name>"] section to use,
 547        this allows SVN multiple repositories to be tracked.
 548        Default: "svn"
 549
 550--follow-parent::
 551        This is especially helpful when we're tracking a directory
 552        that has been moved around within the repository, or if we
 553        started tracking a branch and never tracked the trunk it was
 554        descended from. This feature is enabled by default, use
 555        --no-follow-parent to disable it.
 556
 557config key: svn.followparent
 558
 559--
 560CONFIG FILE-ONLY OPTIONS
 561------------------------
 562--
 563
 564svn.noMetadata::
 565svn-remote.<name>.noMetadata::
 566
 567This gets rid of the 'git-svn-id:' lines at the end of every commit.
 568
 569If you lose your .git/svn/git-svn/.rev_db file, 'git-svn' will not
 570be able to rebuild it and you won't be able to fetch again,
 571either.  This is fine for one-shot imports.
 572
 573The 'git-svn log' command will not work on repositories using
 574this, either.  Using this conflicts with the 'useSvmProps'
 575option for (hopefully) obvious reasons.
 576
 577svn.useSvmProps::
 578svn-remote.<name>.useSvmProps::
 579
 580This allows 'git-svn' to re-map repository URLs and UUIDs from
 581mirrors created using SVN::Mirror (or svk) for metadata.
 582
 583If an SVN revision has a property, "svm:headrev", it is likely
 584that the revision was created by SVN::Mirror (also used by SVK).
 585The property contains a repository UUID and a revision.  We want
 586to make it look like we are mirroring the original URL, so
 587introduce a helper function that returns the original identity
 588URL and UUID, and use it when generating metadata in commit
 589messages.
 590
 591svn.useSvnsyncProps::
 592svn-remote.<name>.useSvnsyncprops::
 593        Similar to the useSvmProps option; this is for users
 594        of the svnsync(1) command distributed with SVN 1.4.x and
 595        later.
 596
 597svn-remote.<name>.rewriteRoot::
 598        This allows users to create repositories from alternate
 599        URLs.  For example, an administrator could run 'git-svn' on the
 600        server locally (accessing via file://) but wish to distribute
 601        the repository with a public http:// or svn:// URL in the
 602        metadata so users of it will see the public URL.
 603
 604svn.brokenSymlinkWorkaround::
 605This disables potentially expensive checks to workaround broken symlinks
 606checked into SVN by broken clients.  Set this option to "false" if you
 607track a SVN repository with many empty blobs that are not symlinks.
 608This option may be changed while "git-svn" is running and take effect on
 609the next revision fetched.  If unset, git-svn assumes this option to be
 610"true".
 611
 612--
 613
 614Since the noMetadata, rewriteRoot, useSvnsyncProps and useSvmProps
 615options all affect the metadata generated and used by 'git-svn'; they
 616*must* be set in the configuration file before any history is imported
 617and these settings should never be changed once they are set.
 618
 619Additionally, only one of these four options can be used per-svn-remote
 620section because they affect the 'git-svn-id:' metadata line.
 621
 622
 623BASIC EXAMPLES
 624--------------
 625
 626Tracking and contributing to the trunk of a Subversion-managed project:
 627
 628------------------------------------------------------------------------
 629# Clone a repo (like git clone):
 630        git svn clone http://svn.example.com/project/trunk
 631# Enter the newly cloned directory:
 632        cd trunk
 633# You should be on master branch, double-check with git-branch
 634        git branch
 635# Do some work and commit locally to git:
 636        git commit ...
 637# Something is committed to SVN, rebase your local changes against the
 638# latest changes in SVN:
 639        git svn rebase
 640# Now commit your changes (that were committed previously using git) to SVN,
 641# as well as automatically updating your working HEAD:
 642        git svn dcommit
 643# Append svn:ignore settings to the default git exclude file:
 644        git svn show-ignore >> .git/info/exclude
 645------------------------------------------------------------------------
 646
 647Tracking and contributing to an entire Subversion-managed project
 648(complete with a trunk, tags and branches):
 649
 650------------------------------------------------------------------------
 651# Clone a repo (like git clone):
 652        git svn clone http://svn.example.com/project -T trunk -b branches -t tags
 653# View all branches and tags you have cloned:
 654        git branch -r
 655# Create a new branch in SVN
 656    git svn branch waldo
 657# Reset your master to trunk (or any other branch, replacing 'trunk'
 658# with the appropriate name):
 659        git reset --hard remotes/trunk
 660# You may only dcommit to one branch/tag/trunk at a time.  The usage
 661# of dcommit/rebase/show-ignore should be the same as above.
 662------------------------------------------------------------------------
 663
 664The initial 'git-svn clone' can be quite time-consuming
 665(especially for large Subversion repositories). If multiple
 666people (or one person with multiple machines) want to use
 667'git-svn' to interact with the same Subversion repository, you can
 668do the initial 'git-svn clone' to a repository on a server and
 669have each person clone that repository with 'git-clone':
 670
 671------------------------------------------------------------------------
 672# Do the initial import on a server
 673        ssh server "cd /pub && git svn clone http://svn.example.com/project
 674# Clone locally - make sure the refs/remotes/ space matches the server
 675        mkdir project
 676        cd project
 677        git init
 678        git remote add origin server:/pub/project
 679        git config --add remote.origin.fetch '+refs/remotes/*:refs/remotes/*'
 680        git fetch
 681# Create a local branch from one of the branches just fetched
 682        git checkout -b master FETCH_HEAD
 683# Initialize git-svn locally (be sure to use the same URL and -T/-b/-t options as were used on server)
 684        git svn init http://svn.example.com/project
 685# Pull the latest changes from Subversion
 686        git svn rebase
 687------------------------------------------------------------------------
 688
 689REBASE VS. PULL/MERGE
 690---------------------
 691
 692Originally, 'git-svn' recommended that the 'remotes/git-svn' branch be
 693pulled or merged from.  This is because the author favored
 694`git svn set-tree B` to commit a single head rather than the
 695`git svn set-tree A..B` notation to commit multiple commits.
 696
 697If you use `git svn set-tree A..B` to commit several diffs and you do
 698not have the latest remotes/git-svn merged into my-branch, you should
 699use `git svn rebase` to update your work branch instead of `git pull` or
 700`git merge`.  `pull`/`merge` can cause non-linear history to be flattened
 701when committing into SVN, which can lead to merge commits reversing
 702previous commits in SVN.
 703
 704DESIGN PHILOSOPHY
 705-----------------
 706Merge tracking in Subversion is lacking and doing branched development
 707with Subversion can be cumbersome as a result.  While 'git-svn' can track
 708copy history (including branches and tags) for repositories adopting a
 709standard layout, it cannot yet represent merge history that happened
 710inside git back upstream to SVN users.  Therefore it is advised that
 711users keep history as linear as possible inside git to ease
 712compatibility with SVN (see the CAVEATS section below).
 713
 714CAVEATS
 715-------
 716
 717For the sake of simplicity and interoperating with a less-capable system
 718(SVN), it is recommended that all 'git-svn' users clone, fetch and dcommit
 719directly from the SVN server, and avoid all 'git-clone'/'pull'/'merge'/'push'
 720operations between git repositories and branches.  The recommended
 721method of exchanging code between git branches and users is
 722'git-format-patch' and 'git-am', or just 'dcommit'ing to the SVN repository.
 723
 724Running 'git-merge' or 'git-pull' is NOT recommended on a branch you
 725plan to 'dcommit' from.  Subversion does not represent merges in any
 726reasonable or useful fashion; so users using Subversion cannot see any
 727merges you've made.  Furthermore, if you merge or pull from a git branch
 728that is a mirror of an SVN branch, 'dcommit' may commit to the wrong
 729branch.
 730
 731'git-clone' does not clone branches under the refs/remotes/ hierarchy or
 732any 'git-svn' metadata, or config.  So repositories created and managed with
 733using 'git-svn' should use 'rsync' for cloning, if cloning is to be done
 734at all.
 735
 736Since 'dcommit' uses rebase internally, any git branches you 'git-push' to
 737before 'dcommit' on will require forcing an overwrite of the existing ref
 738on the remote repository.  This is generally considered bad practice,
 739see the linkgit:git-push[1] documentation for details.
 740
 741Do not use the --amend option of linkgit:git-commit[1] on a change you've
 742already dcommitted.  It is considered bad practice to --amend commits
 743you've already pushed to a remote repository for other users, and
 744dcommit with SVN is analogous to that.
 745
 746When using multiple --branches or --tags, 'git-svn' does not automatically
 747handle name collisions (for example, if two branches from different paths have
 748the same name, or if a branch and a tag have the same name).  In these cases,
 749use 'init' to set up your git repository then, before your first 'fetch', edit
 750the .git/config file so that the branches and tags are associated with
 751different name spaces.  For example:
 752
 753        branches = stable/*:refs/remotes/svn/stable/*
 754        branches = debug/*:refs/remotes/svn/debug/*
 755
 756BUGS
 757----
 758
 759We ignore all SVN properties except svn:executable.  Any unhandled
 760properties are logged to $GIT_DIR/svn/<refname>/unhandled.log
 761
 762Renamed and copied directories are not detected by git and hence not
 763tracked when committing to SVN.  I do not plan on adding support for
 764this as it's quite difficult and time-consuming to get working for all
 765the possible corner cases (git doesn't do it, either).  Committing
 766renamed and copied files are fully supported if they're similar enough
 767for git to detect them.
 768
 769CONFIGURATION
 770-------------
 771
 772'git-svn' stores [svn-remote] configuration information in the
 773repository .git/config file.  It is similar the core git
 774[remote] sections except 'fetch' keys do not accept glob
 775arguments; but they are instead handled by the 'branches'
 776and 'tags' keys.  Since some SVN repositories are oddly
 777configured with multiple projects glob expansions such those
 778listed below are allowed:
 779
 780------------------------------------------------------------------------
 781[svn-remote "project-a"]
 782        url = http://server.org/svn
 783        fetch = trunk/project-a:refs/remotes/project-a/trunk
 784        branches = branches/*/project-a:refs/remotes/project-a/branches/*
 785        tags = tags/*/project-a:refs/remotes/project-a/tags/*
 786------------------------------------------------------------------------
 787
 788Keep in mind that the '\*' (asterisk) wildcard of the local ref
 789(right of the ':') *must* be the farthest right path component;
 790however the remote wildcard may be anywhere as long as it's an
 791independent path component (surrounded by '/' or EOL).   This
 792type of configuration is not automatically created by 'init' and
 793should be manually entered with a text-editor or using 'git-config'.
 794
 795SEE ALSO
 796--------
 797linkgit:git-rebase[1]
 798
 799Author
 800------
 801Written by Eric Wong <normalperson@yhbt.net>.
 802
 803Documentation
 804-------------
 805Written by Eric Wong <normalperson@yhbt.net>.