Changeset 782 for git/branches/dmik/Documentation/git-svn.txt
- Timestamp:
- Jun 23, 2014, 9:45:51 PM (11 years ago)
- Location:
- git/branches/dmik
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
git/branches/dmik ¶
- Property svn:mergeinfo changed
/git/vendor/2.0.0 (added) merged: 777 /git/vendor/current merged: 772,774,776
- Property svn:mergeinfo changed
-
TabularUnified git/branches/dmik/Documentation/git-svn.txt ¶
r626 r782 4 4 NAME 5 5 ---- 6 git-svn - Bidirectional operation between a Subversion repository and git6 git-svn - Bidirectional operation between a Subversion repository and Git 7 7 8 8 SYNOPSIS … … 13 13 DESCRIPTION 14 14 ----------- 15 'git svn' is a simple conduit for changesets between Subversion and git.16 It provides a bidirectional flow of changes between a Subversion and a git15 'git svn' is a simple conduit for changesets between Subversion and Git. 16 It provides a bidirectional flow of changes between a Subversion and a Git 17 17 repository. 18 18 … … 22 22 (see options to 'init' below, and also the 'clone' command). 23 23 24 Once tracking a Subversion repository (with any of the above methods), the git24 Once tracking a Subversion repository (with any of the above methods), the Git 25 25 repository can be updated from Subversion by the 'fetch' command and 26 Subversion updated from git by the 'dcommit' command.26 Subversion updated from Git by the 'dcommit' command. 27 27 28 28 COMMANDS … … 30 30 31 31 'init':: 32 Initializes an empty git repository with additional32 Initializes an empty Git repository with additional 33 33 metadata directories for 'git svn'. The Subversion URL 34 34 may be specified as a command-line argument, or as full … … 80 80 argument if that is what you want. If --branches/-b is 81 81 specified, the prefix must include a trailing slash. 82 Setting a prefix is useful if you wish to track multiple 83 projects that share a common repository. 82 Setting a prefix (with a trailing slash) is strongly 83 encouraged in any case, as your SVN-tracking refs will 84 then be located at "refs/remotes/$prefix/*", which is 85 compatible with Git's own remote-tracking ref layout 86 (refs/remotes/$remote/*). Setting a prefix is also useful 87 if you wish to track multiple projects that share a common 88 repository. 89 By default, the prefix is set to 'origin/'. 90 + 91 NOTE: Before Git v2.0, the default prefix was "" (no prefix). This 92 meant that SVN-tracking refs were put at "refs/remotes/*", which is 93 incompatible with how Git's own remote-tracking refs are organized. 94 If you still want the old default, you can get it by passing 95 `--prefix ""` on the command line (`--prefix=""` may not work if 96 your Perl's Getopt::Long is < v2.37). 97 84 98 --ignore-paths=<regex>;; 85 99 When passed to 'init' or 'clone' this regular expression will 86 100 be preserved as a config key. See 'fetch' for a description 87 101 of '--ignore-paths'. 102 --include-paths=<regex>;; 103 When passed to 'init' or 'clone' this regular expression will 104 be preserved as a config key. See 'fetch' for a description 105 of '--include-paths'. 88 106 --no-minimize-url;; 89 107 When tracking multiple directories (using --stdlayout, … … 101 119 Fetch unfetched revisions from the Subversion remote we are 102 120 tracking. The name of the [svn-remote "..."] section in the 103 .git/config file may be specified as an optional command-line 104 argument. 121 $GIT_DIR/config file may be specified as an optional 122 command-line argument. 123 + 124 This automatically updates the rev_map if needed (see 125 '$GIT_DIR/svn/\*\*/.rev_map.*' in the FILES section below for details). 105 126 106 127 --localtime;; 107 Store Git commit times in the local time zone instead of UTC. This128 Store Git commit times in the local time zone instead of UTC. This 108 129 makes 'git log' (even without --date=local) show the same times 109 that `svn log` would in the local time zone.130 that `svn log` would in the local time zone. 110 131 + 111 132 This doesn't interfere with interoperating with the Subversion … … 113 134 repository to be able to interoperate with someone else's local Git 114 135 repository, either don't use this option or you should both use it in 115 the same local time zone.136 the same local time zone. 116 137 117 138 --parent;; … … 146 167 ------------------------------------------------------------------------ 147 168 -- 169 170 --include-paths=<regex>;; 171 This allows one to specify a Perl regular expression that will 172 cause the inclusion of only matching paths from checkout from SVN. 173 The '--include-paths' option should match for every 'fetch' 174 (including automatic fetches due to 'clone', 'dcommit', 175 'rebase', etc) on a given repository. '--ignore-paths' takes 176 precedence over '--include-paths'. 177 178 --log-window-size=<n>;; 179 Fetch <n> log entries per request when scanning Subversion history. 180 The default is 100. For very large Subversion repositories, larger 181 values may be needed for 'clone'/'fetch' to complete in reasonable 182 time. But overly large values may lead to higher memory usage and 183 request timeouts. 148 184 149 185 'clone':: … … 183 219 Like 'git rebase'; this requires that the working tree be clean 184 220 and have no uncommitted changes. 221 + 222 This automatically updates the rev_map if needed (see 223 '$GIT_DIR/svn/\*\*/.rev_map.*' in the FILES section below for details). 185 224 186 225 -l;; … … 190 229 191 230 'dcommit':: 192 Commit each diff from a specified headdirectly to the SVN231 Commit each diff from the current branch directly to the SVN 193 232 repository, and then rebase or reset (depending on whether or 194 233 not there is a diff between SVN and head). This will create 195 a revision in SVN for each commit in git. 196 It is recommended that you run 'git svn' fetch and rebase (not 197 pull or merge) your commits against the latest changes in the 198 SVN repository. 199 An optional revision or branch argument may be specified, and 200 causes 'git svn' to do all work on that revision/branch 201 instead of HEAD. 202 This is advantageous over 'set-tree' (below) because it produces 203 cleaner, more linear history. 234 a revision in SVN for each commit in Git. 235 + 236 When an optional Git branch name (or a Git commit object name) 237 is specified as an argument, the subcommand works on the specified 238 branch, not on the current branch. 239 + 240 Use of 'dcommit' is preferred to 'set-tree' (below). 204 241 + 205 242 --no-rebase;; … … 240 277 patch), "all" (accept all patches), or "quit". 241 278 + 242 'git svn dcommit' returns immediately if answer i f"no" or "quit", without243 commit ing anything to SVN.279 'git svn dcommit' returns immediately if answer is "no" or "quit", without 280 committing anything to SVN. 244 281 245 282 'branch':: … … 255 292 specified during git svn init. 256 293 257 -d;; 258 --destination;; 294 -d<path>;; 295 --destination=<path>;; 296 259 297 If more than one --branches (or --tags) option was given to the 'init' 260 298 or 'clone' command, you must provide the location of the branch (or 261 tag) you wish to create in the SVN repository. The value of this 262 option must match one of the paths specified by a --branches (or 263 --tags) option. You can see these paths with the commands 299 tag) you wish to create in the SVN repository. <path> specifies which 300 path to use to create the branch or tag and should match the pattern 301 on the left-hand side of one of the configured branches or tags 302 refspecs. You can see these refspecs with the commands 264 303 + 265 304 git config --get-all svn-remote.<name>.branches … … 281 320 git config --get-all svn-remote.<name>.commiturl 282 321 + 322 323 --parents;; 324 Create parent folders. This parameter is equivalent to the parameter 325 --parents on svn cp commands and is useful for non-standard repository 326 layouts. 283 327 284 328 'tag':: … … 312 356 -- 313 357 --show-commit;; 314 shows the git commit sha1, as well358 shows the Git commit sha1, as well 315 359 --oneline;; 316 360 our version of --pretty=oneline … … 324 368 325 369 'blame':: 326 327 328 329 330 331 370 Show what revision and author last modified each line of a file. The 371 output of this mode is format-compatible with the output of 372 `svn blame' by default. Like the SVN blame command, 373 local uncommitted changes in the working tree are ignored; 374 the version of the file in the HEAD revision is annotated. Unknown 375 arguments are passed directly to 'git blame'. 332 376 + 333 377 --git-format;; 334 378 Produce output in the same format as 'git blame', but with 335 SVN revision numbers instead of git commit hashes. In this mode,379 SVN revision numbers instead of Git commit hashes. In this mode, 336 380 changes that haven't been committed to SVN (including local 337 381 working-copy edits) are shown as revision 0. … … 339 383 'find-rev':: 340 384 When given an SVN revision number of the form 'rN', returns the 341 corresponding git commit hash (this can optionally be followed by a385 corresponding Git commit hash (this can optionally be followed by a 342 386 tree-ish to specify which branch should be searched). When given a 343 387 tree-ish, returns the corresponding SVN revision number. 388 + 389 --before;; 390 Don't require an exact match if given an SVN revision, instead find 391 the commit corresponding to the state of the SVN repository (on the 392 current branch) at the specified revision. 393 + 394 --after;; 395 Don't require an exact match if given an SVN revision; if there is 396 not an exact match return the closest match searching forward in the 397 history. 344 398 345 399 'set-tree':: … … 364 418 365 419 'mkdirs':: 366 Attempts to recreate empty directories that core git cannot track420 Attempts to recreate empty directories that core Git cannot track 367 421 based on information in $GIT_DIR/svn/<refname>/unhandled.log files. 368 422 Empty directories are automatically recreated when using … … 402 456 403 457 'gc':: 404 Compress $GIT_DIR/svn/<refname>/unhandled.log files in .git/svn405 and remove $GIT_DIR/svn/<refname>index files in .git/svn.458 Compress $GIT_DIR/svn/<refname>/unhandled.log files and remove 459 $GIT_DIR/svn/<refname>/index files. 406 460 407 461 'reset':: … … 416 470 way to repair the repo is to use 'reset'. 417 471 + 418 Only the rev_map and refs/remotes/git-svn are changed. Follow 'reset' 419 with a 'fetch' and then 'git reset' or 'git rebase' to move local 420 branches onto the new tree. 472 Only the rev_map and refs/remotes/git-svn are changed (see 473 '$GIT_DIR/svn/\*\*/.rev_map.*' in the FILES section below for details). 474 Follow 'reset' with a 'fetch' and then 'git reset' or 'git rebase' to 475 move local branches onto the new tree. 421 476 422 477 -r <n>;; … … 496 551 Remove directories from the SVN tree if there are no files left 497 552 behind. SVN can version empty directories, and they are not 498 removed by default if there are no files left in them. git553 removed by default if there are no files left in them. Git 499 554 cannot version empty directories. Enabling this flag will make 500 the commit to SVN act like git.555 the commit to SVN act like Git. 501 556 + 502 557 [verse] … … 573 628 -s<strategy>:: 574 629 --strategy=<strategy>:: 630 -p:: 631 --preserve-merges:: 575 632 These are only used with the 'dcommit' and 'rebase' commands. 576 633 + … … 583 640 'tag' commands. 584 641 + 585 For 'dcommit', print out the series of git arguments that would show642 For 'dcommit', print out the series of Git arguments that would show 586 643 which diffs would be committed to SVN. 587 644 + … … 594 651 595 652 --use-log-author:: 596 When retrieving svn commits into git (as part of 'fetch', 'rebase', or653 When retrieving svn commits into Git (as part of 'fetch', 'rebase', or 597 654 'dcommit' operations), look for the first `From:` or `Signed-off-by:` line 598 655 in the log message and use that as the author string. 599 656 --add-author-from:: 600 When committing to svn from git (as part of 'commit-diff', 'set-tree' or 'dcommit'657 When committing to svn from Git (as part of 'commit-diff', 'set-tree' or 'dcommit' 601 658 operations), if the existing log message doesn't already have a 602 659 `From:` or `Signed-off-by:` line, append a `From:` line based on the 603 git commit's author string. If you use this, then `--use-log-author`660 Git commit's author string. If you use this, then `--use-log-author` 604 661 will retrieve a valid author string for all commits. 605 662 … … 622 679 623 680 --follow-parent:: 681 This option is only relevant if we are tracking branches (using 682 one of the repository layout options --trunk, --tags, 683 --branches, --stdlayout). For each tracked branch, try to find 684 out where its revision was copied from, and set 685 a suitable parent in the first Git commit for the branch. 624 686 This is especially helpful when we're tracking a directory 625 that has been moved around within the repository, or if we 626 started tracking a branch and never tracked the trunk it was 627 descended from. This feature is enabled by default, use 687 that has been moved around within the repository. If this 688 feature is disabled, the branches created by 'git svn' will all 689 be linear and not share any history, meaning that there will be 690 no information on where branches were branched off or merged. 691 However, following long/convoluted histories can take a long 692 time, so disabling this feature may speed up the cloning 693 process. This feature is enabled by default, use 628 694 --no-follow-parent to disable it. 629 695 + … … 640 706 This option can only be used for one-shot imports as 'git svn' 641 707 will not be able to fetch again without metadata. Additionally, 642 if you lose your .git/svn/**/.rev_map.*files, 'git svn' will not708 if you lose your '$GIT_DIR/svn/\*\*/.rev_map.*' files, 'git svn' will not 643 709 be able to rebuild them. 644 710 + … … 649 715 This option is NOT recommended as it makes it difficult to track down 650 716 old references to SVN revision numbers in existing documentation, bug 651 reports and archives. If you plan to eventually migrate from SVN to git717 reports and archives. If you plan to eventually migrate from SVN to Git 652 718 and are certain about dropping SVN history, consider 653 719 linkgit:git-filter-branch[1] instead. filter-branch also allows … … 689 755 svn-remote.<name>.pushurl:: 690 756 691 Similar to git's 'remote.<name>.pushurl', this key is designed757 Similar to Git's 'remote.<name>.pushurl', this key is designed 692 758 to be used in cases where 'url' points to an SVN repository 693 759 via a read-only transport, to provide an alternate read/write … … 733 799 -------------- 734 800 735 Tracking and contributing to the trunk of a Subversion-managed project: 801 Tracking and contributing to the trunk of a Subversion-managed project 802 (ignoring tags and branches): 736 803 737 804 ------------------------------------------------------------------------ … … 742 809 # You should be on master branch, double-check with 'git branch' 743 810 git branch 744 # Do some work and commit locally to git:811 # Do some work and commit locally to Git: 745 812 git commit ... 746 813 # Something is committed to SVN, rebase your local changes against the 747 814 # latest changes in SVN: 748 815 git svn rebase 749 # Now commit your changes (that were committed previously using git) to SVN,816 # Now commit your changes (that were committed previously using Git) to SVN, 750 817 # as well as automatically updating your working HEAD: 751 818 git svn dcommit 752 # Append svn:ignore settings to the default git exclude file:819 # Append svn:ignore settings to the default Git exclude file: 753 820 git svn show-ignore >> .git/info/exclude 754 821 ------------------------------------------------------------------------ … … 758 825 759 826 ------------------------------------------------------------------------ 760 # Clone a repo (like git clone): 761 git svn clone http://svn.example.com/project -T trunk -b branches -t tags 827 # Clone a repo with standard SVN directory layout (like git clone): 828 git svn clone http://svn.example.com/project --stdlayout --prefix svn/ 829 # Or, if the repo uses a non-standard directory layout: 830 git svn clone http://svn.example.com/project -T tr -b branch -t tag --prefix svn/ 762 831 # View all branches and tags you have cloned: 763 832 git branch -r 764 833 # Create a new branch in SVN 765 834 git svn branch waldo 766 835 # Reset your master to trunk (or any other branch, replacing 'trunk' 767 836 # with the appropriate name): 768 git reset --hard remotes/trunk837 git reset --hard svn/trunk 769 838 # You may only dcommit to one branch/tag/trunk at a time. The usage 770 839 # of dcommit/rebase/show-ignore should be the same as above. … … 780 849 ------------------------------------------------------------------------ 781 850 # Do the initial import on a server 782 ssh server "cd /pub && git svn clone http://svn.example.com/project 851 ssh server "cd /pub && git svn clone http://svn.example.com/project [options...]" 783 852 # Clone locally - make sure the refs/remotes/ space matches the server 784 853 mkdir project … … 788 857 git config --replace-all remote.origin.fetch '+refs/remotes/*:refs/remotes/*' 789 858 git fetch 790 # Prevent fetch/pull from remote git server in the future,859 # Prevent fetch/pull from remote Git server in the future, 791 860 # we only want to use git svn for future updates 792 861 git config --remove-section remote.origin 793 862 # Create a local branch from one of the branches just fetched 794 863 git checkout -b master FETCH_HEAD 795 # Initialize 'git svn' locally (be sure to use the same URL and -T/-b/-t options as were used on server) 796 git svn init http://svn.example.com/project 864 # Initialize 'git svn' locally (be sure to use the same URL and 865 # --stdlayout/-T/-b/-t/--prefix options as were used on server) 866 git svn init http://svn.example.com/project [options...] 797 867 # Pull the latest changes from Subversion 798 868 git svn rebase … … 801 871 REBASE VS. PULL/MERGE 802 872 --------------------- 803 804 Originally, 'git svn' recommended that the 'remotes/git-svn' branch be 805 pulled or merged from. This is because the author favored 873 Prefer to use 'git svn rebase' or 'git rebase', rather than 874 'git pull' or 'git merge' to synchronize unintegrated commits with a 'git svn' 875 branch. Doing so will keep the history of unintegrated commits linear with 876 respect to the upstream SVN repository and allow the use of the preferred 877 'git svn dcommit' subcommand to push unintegrated commits back into SVN. 878 879 Originally, 'git svn' recommended that developers pulled or merged from 880 the 'git svn' branch. This was because the author favored 806 881 `git svn set-tree B` to commit a single head rather than the 807 `git svn set-tree A..B` notation to commit multiple commits. 808 809 If you use `git svn set-tree A..B` to commit several diffs and you do 810 not have the latest remotes/git-svn merged into my-branch, you should 811 use `git svn rebase` to update your work branch instead of `git pull` or 812 `git merge`. `pull`/`merge` can cause non-linear history to be flattened 813 when committing into SVN, which can lead to merge commits reversing 814 previous commits in SVN. 882 `git svn set-tree A..B` notation to commit multiple commits. Use of 883 'git pull' or 'git merge' with `git svn set-tree A..B` will cause non-linear 884 history to be flattened when committing into SVN and this can lead to merge 885 commits unexpectedly reversing previous commits in SVN. 815 886 816 887 MERGE TRACKING … … 820 891 standard layout, it cannot yet represent merge history that happened 821 892 inside git back upstream to SVN users. Therefore it is advised that 822 users keep history as linear as possible inside git to ease893 users keep history as linear as possible inside Git to ease 823 894 compatibility with SVN (see the CAVEATS section below). 895 896 HANDLING OF SVN BRANCHES 897 ------------------------ 898 If 'git svn' is configured to fetch branches (and --follow-branches 899 is in effect), it sometimes creates multiple Git branches for one 900 SVN branch, where the additional branches have names of the form 901 'branchname@nnn' (with nnn an SVN revision number). These additional 902 branches are created if 'git svn' cannot find a parent commit for the 903 first commit in an SVN branch, to connect the branch to the history of 904 the other branches. 905 906 Normally, the first commit in an SVN branch consists 907 of a copy operation. 'git svn' will read this commit to get the SVN 908 revision the branch was created from. It will then try to find the 909 Git commit that corresponds to this SVN revision, and use that as the 910 parent of the branch. However, it is possible that there is no suitable 911 Git commit to serve as parent. This will happen, among other reasons, 912 if the SVN branch is a copy of a revision that was not fetched by 'git 913 svn' (e.g. because it is an old revision that was skipped with 914 '--revision'), or if in SVN a directory was copied that is not tracked 915 by 'git svn' (such as a branch that is not tracked at all, or a 916 subdirectory of a tracked branch). In these cases, 'git svn' will still 917 create a Git branch, but instead of using an existing Git commit as the 918 parent of the branch, it will read the SVN history of the directory the 919 branch was copied from and create appropriate Git commits. This is 920 indicated by the message "Initializing parent: <branchname>". 921 922 Additionally, it will create a special branch named 923 '<branchname>@<SVN-Revision>', where <SVN-Revision> is the SVN revision 924 number the branch was copied from. This branch will point to the newly 925 created parent commit of the branch. If in SVN the branch was deleted 926 and later recreated from a different version, there will be multiple 927 such branches with an '@'. 928 929 Note that this may mean that multiple Git commits are created for a 930 single SVN revision. 931 932 An example: in an SVN repository with a standard 933 trunk/tags/branches layout, a directory trunk/sub is created in r.100. 934 In r.200, trunk/sub is branched by copying it to branches/. 'git svn 935 clone -s' will then create a branch 'sub'. It will also create new Git 936 commits for r.100 through r.199 and use these as the history of branch 937 'sub'. Thus there will be two Git commits for each revision from r.100 938 to r.199 (one containing trunk/, one containing trunk/sub/). Finally, 939 it will create a branch 'sub@200' pointing to the new parent commit of 940 branch 'sub' (i.e. the commit for r.200 and trunk/sub/). 824 941 825 942 CAVEATS … … 829 946 it is recommended that all 'git svn' users clone, fetch and dcommit 830 947 directly from the SVN server, and avoid all 'git clone'/'pull'/'merge'/'push' 831 operations between git repositories and branches. The recommended832 method of exchanging code between git branches and users is948 operations between Git repositories and branches. The recommended 949 method of exchanging code between Git branches and users is 833 950 'git format-patch' and 'git am', or just 'dcommit'ing to the SVN repository. 834 951 835 952 Running 'git merge' or 'git pull' is NOT recommended on a branch you 836 953 plan to 'dcommit' from because Subversion users cannot see any 837 merges you've made. Furthermore, if you merge or pull from a git branch954 merges you've made. Furthermore, if you merge or pull from a Git branch 838 955 that is a mirror of an SVN branch, 'dcommit' may commit to the wrong 839 956 branch. … … 854 971 at all. 855 972 856 Since 'dcommit' uses rebase internally, any git branches you 'git push' to973 Since 'dcommit' uses rebase internally, any Git branches you 'git push' to 857 974 before 'dcommit' on will require forcing an overwrite of the existing ref 858 975 on the remote repository. This is generally considered bad practice, … … 864 981 dcommit with SVN is analogous to that. 865 982 983 When cloning an SVN repository, if none of the options for describing 984 the repository layout is used (--trunk, --tags, --branches, 985 --stdlayout), 'git svn clone' will create a Git repository with 986 completely linear history, where branches and tags appear as separate 987 directories in the working copy. While this is the easiest way to get a 988 copy of a complete repository, for projects with many branches it will 989 lead to a working copy many times larger than just the trunk. Thus for 990 projects using the standard directory structure (trunk/branches/tags), 991 it is recommended to clone with option '--stdlayout'. If the project 992 uses a non-standard structure, and/or if branches and tags are not 993 required, it is easiest to only clone one directory (typically trunk), 994 without giving any repository layout options. If the full history with 995 branches and tags is required, the options '--trunk' / '--branches' / 996 '--tags' must be used. 997 866 998 When using multiple --branches or --tags, 'git svn' does not automatically 867 999 handle name collisions (for example, if two branches from different paths have 868 1000 the same name, or if a branch and a tag have the same name). In these cases, 869 use 'init' to set up your git repository then, before your first 'fetch', edit870 the .git/config file so that the branches and tags are associated with871 different name spaces. For example:1001 use 'init' to set up your Git repository then, before your first 'fetch', edit 1002 the $GIT_DIR/config file so that the branches and tags are associated 1003 with different name spaces. For example: 872 1004 873 1005 branches = stable/*:refs/remotes/svn/stable/* … … 880 1012 properties are logged to $GIT_DIR/svn/<refname>/unhandled.log 881 1013 882 Renamed and copied directories are not detected by git and hence not1014 Renamed and copied directories are not detected by Git and hence not 883 1015 tracked when committing to SVN. I do not plan on adding support for 884 1016 this as it's quite difficult and time-consuming to get working for all 885 the possible corner cases ( git doesn't do it, either). Committing1017 the possible corner cases (Git doesn't do it, either). Committing 886 1018 renamed and copied files is fully supported if they're similar enough 887 for git to detect them. 1019 for Git to detect them. 1020 1021 In SVN, it is possible (though discouraged) to commit changes to a tag 1022 (because a tag is just a directory copy, thus technically the same as a 1023 branch). When cloning an SVN repository, 'git svn' cannot know if such a 1024 commit to a tag will happen in the future. Thus it acts conservatively 1025 and imports all SVN tags as branches, prefixing the tag name with 'tags/'. 888 1026 889 1027 CONFIGURATION … … 891 1029 892 1030 'git svn' stores [svn-remote] configuration information in the 893 repository .git/config file. It is similar the core git1031 repository $GIT_DIR/config file. It is similar the core Git 894 1032 [remote] sections except 'fetch' keys do not accept glob 895 1033 arguments; but they are instead handled by the 'branches' … … 920 1058 url = http://server.org/svn 921 1059 fetch = trunk/src:refs/remotes/trunk 922 branches = branches/{red,green}/src:refs/remotes/branches/* 923 tags = tags/{1.0,2.0}/src:refs/remotes/tags/* 1060 branches = branches/{red,green}/src:refs/remotes/project-a/branches/* 1061 tags = tags/{1.0,2.0}/src:refs/remotes/project-a/tags/* 1062 ------------------------------------------------------------------------ 1063 1064 Multiple fetch, branches, and tags keys are supported: 1065 1066 ------------------------------------------------------------------------ 1067 [svn-remote "messy-repo"] 1068 url = http://server.org/svn 1069 fetch = trunk/project-a:refs/remotes/project-a/trunk 1070 fetch = branches/demos/june-project-a-demo:refs/remotes/project-a/demos/june-demo 1071 branches = branches/server/*:refs/remotes/project-a/branches/* 1072 branches = branches/demos/2011/*:refs/remotes/project-a/2011-demos/* 1073 tags = tags/server/*:refs/remotes/project-a/tags/* 1074 ------------------------------------------------------------------------ 1075 1076 Creating a branch in such a configuration requires disambiguating which 1077 location to use using the -d or --destination flag: 1078 1079 ------------------------------------------------------------------------ 1080 $ git svn branch -d branches/server release-2-3-0 924 1081 ------------------------------------------------------------------------ 925 1082 926 1083 Note that git-svn keeps track of the highest revision in which a branch 927 1084 or tag has appeared. If the subset of branches or tags is changed after 928 fetching, then .git/svn/.metadata must be manually edited to remove (or 929 reset) branches-maxRev and/or tags-maxRev as appropriate. 1085 fetching, then $GIT_DIR/svn/.metadata must be manually edited to remove 1086 (or reset) branches-maxRev and/or tags-maxRev as appropriate. 1087 1088 FILES 1089 ----- 1090 $GIT_DIR/svn/\*\*/.rev_map.*:: 1091 Mapping between Subversion revision numbers and Git commit 1092 names. In a repository where the noMetadata option is not set, 1093 this can be rebuilt from the git-svn-id: lines that are at the 1094 end of every commit (see the 'svn.noMetadata' section above for 1095 details). 1096 + 1097 'git svn fetch' and 'git svn rebase' automatically update the rev_map 1098 if it is missing or not up to date. 'git svn reset' automatically 1099 rewinds it. 930 1100 931 1101 SEE ALSO
Note:
See TracChangeset
for help on using the changeset viewer.