Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 1 | git-svn(1) |
| 2 | ========== |
| 3 | |
| 4 | NAME |
| 5 | ---- |
Junio C Hamano | 688eae0 | 2009-06-28 05:19:50 | [diff] [blame^] | 6 | git-svn - Bidirectional operation between a Subversion repository and git |
Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 7 | |
| 8 | SYNOPSIS |
| 9 | -------- |
Junio C Hamano | fce7c7e | 2008-07-02 03:06:38 | [diff] [blame] | 10 | 'git svn' <command> [options] [arguments] |
Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 11 | |
| 12 | DESCRIPTION |
| 13 | ----------- |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 14 | 'git-svn' is a simple conduit for changesets between Subversion and git. |
Junio C Hamano | 7f80ae8 | 2008-07-30 18:31:35 | [diff] [blame] | 15 | It provides a bidirectional flow of changes between a Subversion and a git |
Junio C Hamano | cb1c44f | 2008-08-06 06:19:33 | [diff] [blame] | 16 | repository. |
Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 17 | |
Junio C Hamano | 688eae0 | 2009-06-28 05:19:50 | [diff] [blame^] | 18 | 'git-svn' can track a standard Subversion repository, |
| 19 | following the common "trunk/branches/tags" layout, with the --stdlayout option. |
| 20 | It 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). |
Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 22 | |
Junio C Hamano | 688eae0 | 2009-06-28 05:19:50 | [diff] [blame^] | 23 | Once tracking a Subversion repository (with any of the above methods), the git |
Junio C Hamano | 7f80ae8 | 2008-07-30 18:31:35 | [diff] [blame] | 24 | repository can be updated from Subversion by the 'fetch' command and |
| 25 | Subversion updated from git by the 'dcommit' command. |
Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 26 | |
| 27 | COMMANDS |
| 28 | -------- |
Junio C Hamano | 6b2cee1 | 2006-08-26 08:43:31 | [diff] [blame] | 29 | -- |
| 30 | |
| 31 | 'init':: |
Junio C Hamano | 00cb371 | 2007-02-23 11:13:52 | [diff] [blame] | 32 | Initializes an empty git repository with additional |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 33 | metadata directories for 'git-svn'. The Subversion URL |
Junio C Hamano | 00cb371 | 2007-02-23 11:13:52 | [diff] [blame] | 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 | |
Junio C Hamano | 67fad6d | 2007-05-06 08:53:12 | [diff] [blame] | 40 | -T<trunk_subdir>;; |
| 41 | --trunk=<trunk_subdir>;; |
| 42 | -t<tags_subdir>;; |
| 43 | --tags=<tags_subdir>;; |
| 44 | -b<branches_subdir>;; |
| 45 | --branches=<branches_subdir>;; |
Junio C Hamano | 377018d | 2007-08-23 08:41:31 | [diff] [blame] | 46 | -s;; |
| 47 | --stdlayout;; |
Junio C Hamano | 00cb371 | 2007-02-23 11:13:52 | [diff] [blame] | 48 | These are optional command-line options for init. Each of |
| 49 | these flags can point to a relative repository path |
Junio C Hamano | 688eae0 | 2009-06-28 05:19:50 | [diff] [blame^] | 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 |
Junio C Hamano | 377018d | 2007-08-23 08:41:31 | [diff] [blame] | 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. |
Junio C Hamano | 67fad6d | 2007-05-06 08:53:12 | [diff] [blame] | 58 | --no-metadata;; |
Junio C Hamano | 00cb371 | 2007-02-23 11:13:52 | [diff] [blame] | 59 | Set the 'noMetadata' option in the [svn-remote] config. |
Junio C Hamano | 67fad6d | 2007-05-06 08:53:12 | [diff] [blame] | 60 | --use-svm-props;; |
Junio C Hamano | 00cb371 | 2007-02-23 11:13:52 | [diff] [blame] | 61 | Set the 'useSvmProps' option in the [svn-remote] config. |
Junio C Hamano | 67fad6d | 2007-05-06 08:53:12 | [diff] [blame] | 62 | --use-svnsync-props;; |
Junio C Hamano | 00cb371 | 2007-02-23 11:13:52 | [diff] [blame] | 63 | Set the 'useSvnsyncProps' option in the [svn-remote] config. |
Junio C Hamano | 67fad6d | 2007-05-06 08:53:12 | [diff] [blame] | 64 | --rewrite-root=<URL>;; |
Junio C Hamano | 00cb371 | 2007-02-23 11:13:52 | [diff] [blame] | 65 | Set the 'rewriteRoot' option in the [svn-remote] config. |
Junio C Hamano | dfccbb0 | 2008-05-26 01:16:14 | [diff] [blame] | 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. |
Junio C Hamano | 67fad6d | 2007-05-06 08:53:12 | [diff] [blame] | 76 | --username=<USER>;; |
Junio C Hamano | 00cb371 | 2007-02-23 11:13:52 | [diff] [blame] | 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 |
Junio C Hamano | 67fad6d | 2007-05-06 08:53:12 | [diff] [blame] | 81 | --prefix=<prefix>;; |
Junio C Hamano | 00cb371 | 2007-02-23 11:13:52 | [diff] [blame] | 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 |
Junio C Hamano | 0a2ad89 | 2007-06-24 22:23:12 | [diff] [blame] | 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. |
Junio C Hamano | 5534441 | 2009-04-12 18:31:19 | [diff] [blame] | 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'. |
Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 94 | |
Junio C Hamano | 6b2cee1 | 2006-08-26 08:43:31 | [diff] [blame] | 95 | 'fetch':: |
Junio C Hamano | 00cb371 | 2007-02-23 11:13:52 | [diff] [blame] | 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. |
Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 100 | |
Junio C Hamano | 8f4ac0d | 2009-01-19 08:35:36 | [diff] [blame] | 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 | |
Junio C Hamano | 5534441 | 2009-04-12 18:31:19 | [diff] [blame] | 106 | --parent;; |
| 107 | Fetch only from the SVN parent of the current HEAD. |
| 108 | |
Junio C Hamano | 8f4ac0d | 2009-01-19 08:35:36 | [diff] [blame] | 109 | This doesn't interfere with interoperating with the Subversion |
| 110 | repository you cloned from, but if you wish for your local Git |
| 111 | repository to be able to interoperate with someone else's local Git |
| 112 | repository, either don't use this option or you should both use it in |
| 113 | the same local timezone. |
| 114 | |
Junio C Hamano | a07e816 | 2009-01-26 17:36:43 | [diff] [blame] | 115 | --ignore-paths=<regex>;; |
Junio C Hamano | 5534441 | 2009-04-12 18:31:19 | [diff] [blame] | 116 | This allows one to specify a Perl regular expression that will |
Junio C Hamano | a07e816 | 2009-01-26 17:36:43 | [diff] [blame] | 117 | cause skipping of all matching paths from checkout from SVN. |
Junio C Hamano | 5534441 | 2009-04-12 18:31:19 | [diff] [blame] | 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. |
Junio C Hamano | a07e816 | 2009-01-26 17:36:43 | [diff] [blame] | 121 | |
Junio C Hamano | 5534441 | 2009-04-12 18:31:19 | [diff] [blame] | 122 | config key: svn-remote.<name>.ignore-paths |
Junio C Hamano | a07e816 | 2009-01-26 17:36:43 | [diff] [blame] | 123 | |
Junio C Hamano | 5534441 | 2009-04-12 18:31:19 | [diff] [blame] | 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. |
Junio C Hamano | a07e816 | 2009-01-26 17:36:43 | [diff] [blame] | 127 | |
Junio C Hamano | 5534441 | 2009-04-12 18:31:19 | [diff] [blame] | 128 | Examples: |
| 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. |
Junio C Hamano | a07e816 | 2009-01-26 17:36:43 | [diff] [blame] | 135 | |
Junio C Hamano | 00cb371 | 2007-02-23 11:13:52 | [diff] [blame] | 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. |
Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 146 | |
Junio C Hamano | 00cb371 | 2007-02-23 11:13:52 | [diff] [blame] | 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 | |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 151 | This works similarly to `svn update` or 'git-pull' except that |
| 152 | it preserves linear history with 'git-rebase' instead of |
Junio C Hamano | 610d176 | 2008-11-28 06:27:13 | [diff] [blame] | 153 | 'git-merge' for ease of dcommitting with 'git-svn'. |
Junio C Hamano | 00cb371 | 2007-02-23 11:13:52 | [diff] [blame] | 154 | |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 155 | This accepts all options that 'git-svn fetch' and 'git-rebase' |
Junio C Hamano | fce7c7e | 2008-07-02 03:06:38 | [diff] [blame] | 156 | accept. However, '--fetch-all' only fetches from the current |
Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 157 | [svn-remote], and not all [svn-remote] definitions. |
Junio C Hamano | 00cb371 | 2007-02-23 11:13:52 | [diff] [blame] | 158 | |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 159 | Like 'git-rebase'; this requires that the working tree be clean |
Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 160 | and have no uncommitted changes. |
Junio C Hamano | 67fad6d | 2007-05-06 08:53:12 | [diff] [blame] | 161 | |
Junio C Hamano | 103ad7f | 2007-03-14 11:19:26 | [diff] [blame] | 162 | -l;; |
| 163 | --local;; |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 164 | Do not fetch remotely; only run 'git-rebase' against the |
Junio C Hamano | 103ad7f | 2007-03-14 11:19:26 | [diff] [blame] | 165 | last fetched commit from the upstream SVN. |
Junio C Hamano | 6b2cee1 | 2006-08-26 08:43:31 | [diff] [blame] | 166 | |
| 167 | 'dcommit':: |
Junio C Hamano | 79770b6 | 2007-01-07 07:43:58 | [diff] [blame] | 168 | Commit each diff from a specified head directly to the SVN |
Junio C Hamano | 6b2cee1 | 2006-08-26 08:43:31 | [diff] [blame] | 169 | repository, and then rebase or reset (depending on whether or |
Junio C Hamano | 79770b6 | 2007-01-07 07:43:58 | [diff] [blame] | 170 | not there is a diff between SVN and head). This will create |
| 171 | a revision in SVN for each commit in git. |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 172 | It is recommended that you run 'git-svn' fetch and rebase (not |
Junio C Hamano | 79770b6 | 2007-01-07 07:43:58 | [diff] [blame] | 173 | pull or merge) your commits against the latest changes in the |
| 174 | SVN repository. |
Junio C Hamano | 688eae0 | 2009-06-28 05:19:50 | [diff] [blame^] | 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. |
Junio C Hamano | 4bf6dca | 2006-12-21 02:25:57 | [diff] [blame] | 178 | This is advantageous over 'set-tree' (below) because it produces |
Junio C Hamano | 6b2cee1 | 2006-08-26 08:43:31 | [diff] [blame] | 179 | cleaner, more linear history. |
Junio C Hamano | 67fad6d | 2007-05-06 08:53:12 | [diff] [blame] | 180 | + |
| 181 | --no-rebase;; |
| 182 | After committing, do not rebase or reset. |
Junio C Hamano | faa1e50 | 2008-08-10 03:55:58 | [diff] [blame] | 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 | |
Junio C Hamano | a50c35c | 2009-02-24 07:37:05 | [diff] [blame] | 190 | config key: svn-remote.<name>.commiturl |
| 191 | |
| 192 | config key: svn.commiturl (overwrites all svn-remote.<name>.commiturl options) |
| 193 | |
Junio C Hamano | faa1e50 | 2008-08-10 03:55:58 | [diff] [blame] | 194 | Using this option for any other purpose (don't ask) |
| 195 | is very strongly discouraged. |
Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 196 | -- |
Junio C Hamano | 6b2cee1 | 2006-08-26 08:43:31 | [diff] [blame] | 197 | |
Junio C Hamano | a476efa | 2008-10-10 15:31:42 | [diff] [blame] | 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 | |
Junio C Hamano | 688eae0 | 2009-06-28 05:19:50 | [diff] [blame^] | 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 | + |
| 221 | where <name> is the name of the SVN repository as specified by the -R option to |
| 222 | 'init' (or "svn" by default). |
| 223 | |
Junio C Hamano | a476efa | 2008-10-10 15:31:42 | [diff] [blame] | 224 | 'tag':: |
| 225 | Create a tag in the SVN repository. This is a shorthand for |
| 226 | 'branch -t'. |
| 227 | |
Junio C Hamano | 43d0134 | 2006-10-12 04:07:32 | [diff] [blame] | 228 | 'log':: |
| 229 | This should make it easy to look up svn log messages when svn |
| 230 | users refer to -r/--revision numbers. |
Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 231 | + |
| 232 | The following features from `svn log' are supported: |
| 233 | + |
| 234 | -- |
Junio C Hamano | 688eae0 | 2009-06-28 05:19:50 | [diff] [blame^] | 235 | -r/--revision=<n>[:<n>];; |
Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 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 | + |
| 248 | New features: |
| 249 | + |
| 250 | -- |
| 251 | --show-commit;; |
| 252 | shows the git commit sha1, as well |
| 253 | --oneline;; |
| 254 | our version of --pretty=oneline |
| 255 | -- |
| 256 | + |
Junio C Hamano | 24bc09a | 2008-02-28 00:27:44 | [diff] [blame] | 257 | NOTE: SVN itself only stores times in UTC and nothing else. The regular svn |
| 258 | client converts the UTC time to the local time (or based on the TZ= |
| 259 | environment). This command has the same behaviour. |
| 260 | + |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 261 | Any other arguments are passed directly to 'git-log' |
Junio C Hamano | 43d0134 | 2006-10-12 04:07:32 | [diff] [blame] | 262 | |
Junio C Hamano | 9c33415 | 2008-02-12 03:18:52 | [diff] [blame] | 263 | 'blame':: |
Junio C Hamano | 869bb80 | 2008-05-12 00:29:47 | [diff] [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 |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 269 | arguments are passed directly to 'git-blame'. |
Junio C Hamano | 9c33415 | 2008-02-12 03:18:52 | [diff] [blame] | 270 | + |
Junio C Hamano | 869bb80 | 2008-05-12 00:29:47 | [diff] [blame] | 271 | --git-format;; |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 272 | Produce output in the same format as 'git-blame', but with |
Junio C Hamano | 869bb80 | 2008-05-12 00:29:47 | [diff] [blame] | 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. |
Junio C Hamano | 9c33415 | 2008-02-12 03:18:52 | [diff] [blame] | 276 | |
Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 277 | -- |
Junio C Hamano | 469d60e | 2007-04-29 18:30:34 | [diff] [blame] | 278 | 'find-rev':: |
| 279 | When given an SVN revision number of the form 'rN', returns the |
Junio C Hamano | b63afff | 2007-05-01 03:05:55 | [diff] [blame] | 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. |
Junio C Hamano | 469d60e | 2007-04-29 18:30:34 | [diff] [blame] | 283 | |
Junio C Hamano | 4bf6dca | 2006-12-21 02:25:57 | [diff] [blame] | 284 | 'set-tree':: |
Junio C Hamano | 43d0134 | 2006-10-12 04:07:32 | [diff] [blame] | 285 | You should consider using 'dcommit' instead of this command. |
Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 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 |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 291 | independently of 'git-svn' functions. |
Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 292 | |
Junio C Hamano | 47d68a5 | 2008-05-06 06:35:40 | [diff] [blame] | 293 | 'create-ignore':: |
Junio C Hamano | 47d68a5 | 2008-05-06 06:35:40 | [diff] [blame] | 294 | Recursively finds the svn:ignore property on directories and |
| 295 | creates matching .gitignore files. The resulting files are staged to |
Junio C Hamano | feeb1be | 2008-05-22 00:53:35 | [diff] [blame] | 296 | be committed, but are not committed. Use -r/--revision to refer to a |
Junio C Hamano | cb1c44f | 2008-08-06 06:19:33 | [diff] [blame] | 297 | specific revision. |
Junio C Hamano | 47d68a5 | 2008-05-06 06:35:40 | [diff] [blame] | 298 | |
Junio C Hamano | 6b2cee1 | 2006-08-26 08:43:31 | [diff] [blame] | 299 | 'show-ignore':: |
Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 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 | |
Junio C Hamano | 43d0134 | 2006-10-12 04:07:32 | [diff] [blame] | 304 | 'commit-diff':: |
| 305 | Commits the diff of two tree-ish arguments from the |
Junio C Hamano | 7f80ae8 | 2008-07-30 18:31:35 | [diff] [blame] | 306 | command-line. This command does not rely on being inside an `git-svn |
Junio C Hamano | fce7c7e | 2008-07-02 03:06:38 | [diff] [blame] | 307 | init`-ed repository. This command takes three arguments, (a) the |
Junio C Hamano | 43d0134 | 2006-10-12 04:07:32 | [diff] [blame] | 308 | original tree to diff against, (b) the new tree result, (c) the |
| 309 | URL of the target Subversion repository. The final argument |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 310 | (URL) may be omitted if you are working from a 'git-svn'-aware |
| 311 | repository (that has been `init`-ed with 'git-svn'). |
Junio C Hamano | 23db885 | 2006-11-09 23:35:53 | [diff] [blame] | 312 | The -r<revision> option is required for this. |
Junio C Hamano | 43d0134 | 2006-10-12 04:07:32 | [diff] [blame] | 313 | |
Junio C Hamano | a097054 | 2007-11-23 08:43:30 | [diff] [blame] | 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 | |
Junio C Hamano | feeb1be | 2008-05-22 00:53:35 | [diff] [blame] | 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 | |
Junio C Hamano | 688eae0 | 2009-06-28 05:19:50 | [diff] [blame^] | 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 | |
| 344 | Only the rev_map and refs/remotes/git-svn are changed. Follow 'reset' |
| 345 | with a 'fetch' and then 'git-reset' or 'git-rebase' to move local |
| 346 | branches 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. |
| 354 | Example:;; |
| 355 | Assume 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 | |
| 363 | Fix the ignore-paths or SVN permissions problem that caused "r2" to |
| 364 | be incomplete in the first place. Then: |
| 365 | |
| 366 | [verse] |
| 367 | git svn reset -r2 -p |
| 368 | git svn fetch |
| 369 | |
| 370 | ------------ |
| 371 | r1---r2'--r3' remotes/git-svn |
| 372 | \ |
| 373 | r2---r3---A---B master |
| 374 | ------------ |
| 375 | |
| 376 | Then fixup "master" with 'git-rebase'. |
| 377 | Do NOT use 'git-merge' or your history will not be compatible with a |
| 378 | future 'dcommit'! |
| 379 | |
| 380 | [verse] |
| 381 | git rebase --onto remotes/git-svn A^ master |
| 382 | |
| 383 | ------------ |
| 384 | r1---r2'--r3' remotes/git-svn |
| 385 | \ |
| 386 | A'--B' master |
| 387 | ------------ |
| 388 | |
| 389 | |
Junio C Hamano | 6b2cee1 | 2006-08-26 08:43:31 | [diff] [blame] | 390 | -- |
| 391 | |
Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 392 | OPTIONS |
| 393 | ------- |
Junio C Hamano | 6b2cee1 | 2006-08-26 08:43:31 | [diff] [blame] | 394 | -- |
| 395 | |
Junio C Hamano | 00cb371 | 2007-02-23 11:13:52 | [diff] [blame] | 396 | --shared[={false|true|umask|group|all|world|everybody}]:: |
Junio C Hamano | 43d0134 | 2006-10-12 04:07:32 | [diff] [blame] | 397 | --template=<template_directory>:: |
| 398 | Only used with the 'init' command. |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 399 | These are passed directly to 'git-init'. |
Junio C Hamano | 43d0134 | 2006-10-12 04:07:32 | [diff] [blame] | 400 | |
Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 401 | -r <ARG>:: |
| 402 | --revision <ARG>:: |
Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 403 | |
Junio C Hamano | 00cb371 | 2007-02-23 11:13:52 | [diff] [blame] | 404 | Used with the 'fetch' command. |
Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 405 | |
Junio C Hamano | 00cb371 | 2007-02-23 11:13:52 | [diff] [blame] | 406 | This allows revision ranges for partial/cauterized history |
| 407 | to be supported. $NUMBER, $NUMBER1:$NUMBER2 (numeric ranges), |
| 408 | $NUMBER:HEAD, and BASE:$NUMBER are all supported. |
Junio C Hamano | 6b2cee1 | 2006-08-26 08:43:31 | [diff] [blame] | 409 | |
Junio C Hamano | 00cb371 | 2007-02-23 11:13:52 | [diff] [blame] | 410 | This can allow you to make partial mirrors when running fetch; |
| 411 | but is generally not recommended because history will be skipped |
| 412 | and lost. |
Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 413 | |
| 414 | -:: |
| 415 | --stdin:: |
Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 416 | |
Junio C Hamano | 4bf6dca | 2006-12-21 02:25:57 | [diff] [blame] | 417 | Only used with the 'set-tree' command. |
Junio C Hamano | 6b2cee1 | 2006-08-26 08:43:31 | [diff] [blame] | 418 | |
| 419 | Read a list of commits from stdin and commit them in reverse |
| 420 | order. Only the leading sha1 is read from each line, so |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 421 | 'git-rev-list --pretty=oneline' output can be used. |
Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 422 | |
| 423 | --rmdir:: |
Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 424 | |
Junio C Hamano | 4bf6dca | 2006-12-21 02:25:57 | [diff] [blame] | 425 | Only used with the 'dcommit', 'set-tree' and 'commit-diff' commands. |
Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 426 | |
Junio C Hamano | 6b2cee1 | 2006-08-26 08:43:31 | [diff] [blame] | 427 | Remove directories from the SVN tree if there are no files left |
| 428 | behind. SVN can version empty directories, and they are not |
| 429 | removed by default if there are no files left in them. git |
| 430 | cannot version empty directories. Enabling this flag will make |
| 431 | the commit to SVN act like git. |
| 432 | |
Junio C Hamano | 7ad22dc | 2007-01-29 02:55:48 | [diff] [blame] | 433 | config key: svn.rmdir |
Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 434 | |
| 435 | -e:: |
| 436 | --edit:: |
Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 437 | |
Junio C Hamano | 4bf6dca | 2006-12-21 02:25:57 | [diff] [blame] | 438 | Only used with the 'dcommit', 'set-tree' and 'commit-diff' commands. |
Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 439 | |
Junio C Hamano | 6b2cee1 | 2006-08-26 08:43:31 | [diff] [blame] | 440 | Edit the commit message before committing to SVN. This is off by |
| 441 | default for objects that are commits, and forced on when committing |
| 442 | tree objects. |
| 443 | |
Junio C Hamano | 7ad22dc | 2007-01-29 02:55:48 | [diff] [blame] | 444 | config key: svn.edit |
Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 445 | |
| 446 | -l<num>:: |
| 447 | --find-copies-harder:: |
Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 448 | |
Junio C Hamano | 4bf6dca | 2006-12-21 02:25:57 | [diff] [blame] | 449 | Only used with the 'dcommit', 'set-tree' and 'commit-diff' commands. |
Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 450 | |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 451 | They are both passed directly to 'git-diff-tree'; see |
Junio C Hamano | 35738e8 | 2008-01-07 07:55:46 | [diff] [blame] | 452 | linkgit:git-diff-tree[1] for more information. |
Junio C Hamano | 6b2cee1 | 2006-08-26 08:43:31 | [diff] [blame] | 453 | |
| 454 | [verse] |
Junio C Hamano | 7ad22dc | 2007-01-29 02:55:48 | [diff] [blame] | 455 | config key: svn.l |
| 456 | config key: svn.findcopiesharder |
Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 457 | |
| 458 | -A<filename>:: |
| 459 | --authors-file=<filename>:: |
| 460 | |
Junio C Hamano | 7f80ae8 | 2008-07-30 18:31:35 | [diff] [blame] | 461 | Syntax is compatible with the file used by 'git-cvsimport': |
Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 462 | |
| 463 | ------------------------------------------------------------------------ |
Junio C Hamano | 6b2cee1 | 2006-08-26 08:43:31 | [diff] [blame] | 464 | loginname = Joe User <user@example.com> |
Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 465 | ------------------------------------------------------------------------ |
| 466 | |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 467 | If this option is specified and 'git-svn' encounters an SVN |
| 468 | committer name that does not exist in the authors-file, 'git-svn' |
Junio C Hamano | 6b2cee1 | 2006-08-26 08:43:31 | [diff] [blame] | 469 | will abort operation. The user will then have to add the |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 470 | appropriate entry. Re-running the previous 'git-svn' command |
Junio C Hamano | 6b2cee1 | 2006-08-26 08:43:31 | [diff] [blame] | 471 | after the authors-file is modified should continue operation. |
Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 472 | |
Junio C Hamano | 7ad22dc | 2007-01-29 02:55:48 | [diff] [blame] | 473 | config key: svn.authorsfile |
Junio C Hamano | 43d0134 | 2006-10-12 04:07:32 | [diff] [blame] | 474 | |
Junio C Hamano | 52d5def | 2009-05-21 16:27:43 | [diff] [blame] | 475 | --authors-prog=<filename>:: |
| 476 | |
| 477 | If this option is specified, for each SVN committer name that does not |
| 478 | exist in the authors file, the given file is executed with the committer |
| 479 | name as the first argument. The program is expected to return a single |
| 480 | line of the form "Name <email>", which will be treated as if included in |
| 481 | the authors file. |
| 482 | |
Junio C Hamano | 43d0134 | 2006-10-12 04:07:32 | [diff] [blame] | 483 | -q:: |
| 484 | --quiet:: |
Junio C Hamano | 9572e92 | 2009-04-02 06:52:03 | [diff] [blame] | 485 | Make 'git-svn' less verbose. Specify a second time to make it |
| 486 | even less verbose. |
Junio C Hamano | 43d0134 | 2006-10-12 04:07:32 | [diff] [blame] | 487 | |
| 488 | --repack[=<n>]:: |
Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 489 | --repack-flags=<flags>:: |
Junio C Hamano | 43d0134 | 2006-10-12 04:07:32 | [diff] [blame] | 490 | |
Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 491 | These should help keep disk usage sane for large fetches |
| 492 | with many revisions. |
Junio C Hamano | 43d0134 | 2006-10-12 04:07:32 | [diff] [blame] | 493 | |
Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 494 | --repack takes an optional argument for the number of revisions |
| 495 | to fetch before repacking. This defaults to repacking every |
| 496 | 1000 commits fetched if no argument is specified. |
Junio C Hamano | 43d0134 | 2006-10-12 04:07:32 | [diff] [blame] | 497 | |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 498 | --repack-flags are passed directly to 'git-repack'. |
Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 499 | |
| 500 | [verse] |
Junio C Hamano | 7ad22dc | 2007-01-29 02:55:48 | [diff] [blame] | 501 | config key: svn.repack |
| 502 | config key: svn.repackflags |
Junio C Hamano | 6b2cee1 | 2006-08-26 08:43:31 | [diff] [blame] | 503 | |
| 504 | -m:: |
| 505 | --merge:: |
| 506 | -s<strategy>:: |
| 507 | --strategy=<strategy>:: |
| 508 | |
Junio C Hamano | 00cb371 | 2007-02-23 11:13:52 | [diff] [blame] | 509 | These are only used with the 'dcommit' and 'rebase' commands. |
Junio C Hamano | 6b2cee1 | 2006-08-26 08:43:31 | [diff] [blame] | 510 | |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 511 | Passed directly to 'git-rebase' when using 'dcommit' if a |
| 512 | 'git-reset' cannot be used (see 'dcommit'). |
Junio C Hamano | 6b2cee1 | 2006-08-26 08:43:31 | [diff] [blame] | 513 | |
| 514 | -n:: |
| 515 | --dry-run:: |
| 516 | |
Junio C Hamano | a476efa | 2008-10-10 15:31:42 | [diff] [blame] | 517 | This can be used with the 'dcommit', 'rebase', 'branch' and 'tag' |
| 518 | commands. |
Junio C Hamano | 6b2cee1 | 2006-08-26 08:43:31 | [diff] [blame] | 519 | |
Junio C Hamano | 9e1793f | 2008-06-02 07:31:16 | [diff] [blame] | 520 | For 'dcommit', print out the series of git arguments that would show |
Junio C Hamano | 6b2cee1 | 2006-08-26 08:43:31 | [diff] [blame] | 521 | which diffs would be committed to SVN. |
| 522 | |
Junio C Hamano | 9e1793f | 2008-06-02 07:31:16 | [diff] [blame] | 523 | For 'rebase', display the local branch associated with the upstream svn |
| 524 | repository associated with the current branch and the URL of svn |
| 525 | repository that will be fetched from. |
| 526 | |
Junio C Hamano | a476efa | 2008-10-10 15:31:42 | [diff] [blame] | 527 | For 'branch' and 'tag', display the urls that will be used for copying when |
| 528 | creating the branch or tag. |
| 529 | |
Junio C Hamano | 6b2cee1 | 2006-08-26 08:43:31 | [diff] [blame] | 530 | -- |
Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 531 | |
| 532 | ADVANCED OPTIONS |
| 533 | ---------------- |
Junio C Hamano | 6b2cee1 | 2006-08-26 08:43:31 | [diff] [blame] | 534 | -- |
| 535 | |
Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 536 | -i<GIT_SVN_ID>:: |
| 537 | --id <GIT_SVN_ID>:: |
Junio C Hamano | 6b2cee1 | 2006-08-26 08:43:31 | [diff] [blame] | 538 | |
Junio C Hamano | 00cb371 | 2007-02-23 11:13:52 | [diff] [blame] | 539 | This sets GIT_SVN_ID (instead of using the environment). This |
| 540 | allows the user to override the default refname to fetch from |
| 541 | when tracking a single URL. The 'log' and 'dcommit' commands |
| 542 | no 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" |
Junio C Hamano | 6b2cee1 | 2006-08-26 08:43:31 | [diff] [blame] | 549 | |
Junio C Hamano | 43d0134 | 2006-10-12 04:07:32 | [diff] [blame] | 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 |
Junio C Hamano | 00cb371 | 2007-02-23 11:13:52 | [diff] [blame] | 554 | descended from. This feature is enabled by default, use |
| 555 | --no-follow-parent to disable it. |
Junio C Hamano | 43d0134 | 2006-10-12 04:07:32 | [diff] [blame] | 556 | |
Junio C Hamano | 7ad22dc | 2007-01-29 02:55:48 | [diff] [blame] | 557 | config key: svn.followparent |
Junio C Hamano | 43d0134 | 2006-10-12 04:07:32 | [diff] [blame] | 558 | |
Junio C Hamano | 00cb371 | 2007-02-23 11:13:52 | [diff] [blame] | 559 | -- |
| 560 | CONFIG FILE-ONLY OPTIONS |
| 561 | ------------------------ |
| 562 | -- |
| 563 | |
| 564 | svn.noMetadata:: |
| 565 | svn-remote.<name>.noMetadata:: |
Junio C Hamano | 43d0134 | 2006-10-12 04:07:32 | [diff] [blame] | 566 | |
Junio C Hamano | fce7c7e | 2008-07-02 03:06:38 | [diff] [blame] | 567 | This gets rid of the 'git-svn-id:' lines at the end of every commit. |
Junio C Hamano | 43d0134 | 2006-10-12 04:07:32 | [diff] [blame] | 568 | |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 569 | If you lose your .git/svn/git-svn/.rev_db file, 'git-svn' will not |
Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 570 | be able to rebuild it and you won't be able to fetch again, |
| 571 | either. This is fine for one-shot imports. |
| 572 | |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 573 | The 'git-svn log' command will not work on repositories using |
Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 574 | this, either. Using this conflicts with the 'useSvmProps' |
| 575 | option for (hopefully) obvious reasons. |
Junio C Hamano | 43d0134 | 2006-10-12 04:07:32 | [diff] [blame] | 576 | |
Junio C Hamano | 00cb371 | 2007-02-23 11:13:52 | [diff] [blame] | 577 | svn.useSvmProps:: |
| 578 | svn-remote.<name>.useSvmProps:: |
Junio C Hamano | 43d0134 | 2006-10-12 04:07:32 | [diff] [blame] | 579 | |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 580 | This allows 'git-svn' to re-map repository URLs and UUIDs from |
Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 581 | mirrors created using SVN::Mirror (or svk) for metadata. |
| 582 | |
| 583 | If an SVN revision has a property, "svm:headrev", it is likely |
| 584 | that the revision was created by SVN::Mirror (also used by SVK). |
| 585 | The property contains a repository UUID and a revision. We want |
| 586 | to make it look like we are mirroring the original URL, so |
| 587 | introduce a helper function that returns the original identity |
| 588 | URL and UUID, and use it when generating metadata in commit |
| 589 | messages. |
Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 590 | |
Junio C Hamano | 00cb371 | 2007-02-23 11:13:52 | [diff] [blame] | 591 | svn.useSvnsyncProps:: |
| 592 | svn-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. |
Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 596 | |
Junio C Hamano | 00cb371 | 2007-02-23 11:13:52 | [diff] [blame] | 597 | svn-remote.<name>.rewriteRoot:: |
| 598 | This allows users to create repositories from alternate |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 599 | URLs. For example, an administrator could run 'git-svn' on the |
Junio C Hamano | 00cb371 | 2007-02-23 11:13:52 | [diff] [blame] | 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. |
Junio C Hamano | 6b2cee1 | 2006-08-26 08:43:31 | [diff] [blame] | 603 | |
Junio C Hamano | b325006 | 2009-02-11 20:16:50 | [diff] [blame] | 604 | svn.brokenSymlinkWorkaround:: |
| 605 | This disables potentially expensive checks to workaround broken symlinks |
| 606 | checked into SVN by broken clients. Set this option to "false" if you |
| 607 | track a SVN repository with many empty blobs that are not symlinks. |
| 608 | This option may be changed while "git-svn" is running and take effect on |
| 609 | the next revision fetched. If unset, git-svn assumes this option to be |
| 610 | "true". |
| 611 | |
Junio C Hamano | 0538b89 | 2008-06-20 04:18:33 | [diff] [blame] | 612 | -- |
| 613 | |
Junio C Hamano | 00cb371 | 2007-02-23 11:13:52 | [diff] [blame] | 614 | Since the noMetadata, rewriteRoot, useSvnsyncProps and useSvmProps |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 615 | options all affect the metadata generated and used by 'git-svn'; they |
Junio C Hamano | 00cb371 | 2007-02-23 11:13:52 | [diff] [blame] | 616 | *must* be set in the configuration file before any history is imported |
| 617 | and these settings should never be changed once they are set. |
Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 618 | |
Junio C Hamano | 00cb371 | 2007-02-23 11:13:52 | [diff] [blame] | 619 | Additionally, only one of these four options can be used per-svn-remote |
| 620 | section because they affect the 'git-svn-id:' metadata line. |
Junio C Hamano | 47c1e3c | 2006-09-25 04:45:55 | [diff] [blame] | 621 | |
Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 622 | |
Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 623 | BASIC EXAMPLES |
| 624 | -------------- |
Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 625 | |
Junio C Hamano | 764a667 | 2007-10-23 01:23:31 | [diff] [blame] | 626 | Tracking and contributing to the trunk of a Subversion-managed project: |
Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 627 | |
| 628 | ------------------------------------------------------------------------ |
Junio C Hamano | 00cb371 | 2007-02-23 11:13:52 | [diff] [blame] | 629 | # Clone a repo (like git clone): |
Junio C Hamano | a476efa | 2008-10-10 15:31:42 | [diff] [blame] | 630 | git svn clone http://svn.example.com/project/trunk |
Junio C Hamano | 00cb371 | 2007-02-23 11:13:52 | [diff] [blame] | 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: |
Junio C Hamano | fce7c7e | 2008-07-02 03:06:38 | [diff] [blame] | 639 | git svn rebase |
Junio C Hamano | 00cb371 | 2007-02-23 11:13:52 | [diff] [blame] | 640 | # Now commit your changes (that were committed previously using git) to SVN, |
| 641 | # as well as automatically updating your working HEAD: |
Junio C Hamano | fce7c7e | 2008-07-02 03:06:38 | [diff] [blame] | 642 | git svn dcommit |
Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 643 | # Append svn:ignore settings to the default git exclude file: |
Junio C Hamano | fce7c7e | 2008-07-02 03:06:38 | [diff] [blame] | 644 | git svn show-ignore >> .git/info/exclude |
Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 645 | ------------------------------------------------------------------------ |
| 646 | |
Junio C Hamano | a8d072a | 2007-01-05 07:46:25 | [diff] [blame] | 647 | Tracking and contributing to an entire Subversion-managed project |
| 648 | (complete with a trunk, tags and branches): |
Junio C Hamano | a8d072a | 2007-01-05 07:46:25 | [diff] [blame] | 649 | |
| 650 | ------------------------------------------------------------------------ |
Junio C Hamano | 00cb371 | 2007-02-23 11:13:52 | [diff] [blame] | 651 | # Clone a repo (like git clone): |
Junio C Hamano | a476efa | 2008-10-10 15:31:42 | [diff] [blame] | 652 | git svn clone http://svn.example.com/project -T trunk -b branches -t tags |
Junio C Hamano | 00cb371 | 2007-02-23 11:13:52 | [diff] [blame] | 653 | # View all branches and tags you have cloned: |
| 654 | git branch -r |
Junio C Hamano | a476efa | 2008-10-10 15:31:42 | [diff] [blame] | 655 | # Create a new branch in SVN |
| 656 | git svn branch waldo |
Junio C Hamano | 00cb371 | 2007-02-23 11:13:52 | [diff] [blame] | 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 |
Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 661 | # of dcommit/rebase/show-ignore should be the same as above. |
Junio C Hamano | a8d072a | 2007-01-05 07:46:25 | [diff] [blame] | 662 | ------------------------------------------------------------------------ |
| 663 | |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 664 | The initial 'git-svn clone' can be quite time-consuming |
Junio C Hamano | e9bfa9b | 2007-08-07 06:06:11 | [diff] [blame] | 665 | (especially for large Subversion repositories). If multiple |
| 666 | people (or one person with multiple machines) want to use |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 667 | 'git-svn' to interact with the same Subversion repository, you can |
| 668 | do the initial 'git-svn clone' to a repository on a server and |
| 669 | have each person clone that repository with 'git-clone': |
Junio C Hamano | e9bfa9b | 2007-08-07 06:06:11 | [diff] [blame] | 670 | |
| 671 | ------------------------------------------------------------------------ |
| 672 | # Do the initial import on a server |
Junio C Hamano | a476efa | 2008-10-10 15:31:42 | [diff] [blame] | 673 | ssh server "cd /pub && git svn clone http://svn.example.com/project |
Junio C Hamano | f7bb669 | 2008-01-27 08:23:46 | [diff] [blame] | 674 | # Clone locally - make sure the refs/remotes/ space matches the server |
| 675 | mkdir project |
| 676 | cd project |
Junio C Hamano | fce7c7e | 2008-07-02 03:06:38 | [diff] [blame] | 677 | git init |
Junio C Hamano | f7bb669 | 2008-01-27 08:23:46 | [diff] [blame] | 678 | git remote add origin server:/pub/project |
Junio C Hamano | 9e7b3f3 | 2008-06-29 08:49:03 | [diff] [blame] | 679 | git config --add remote.origin.fetch '+refs/remotes/*:refs/remotes/*' |
Junio C Hamano | f7bb669 | 2008-01-27 08:23:46 | [diff] [blame] | 680 | git fetch |
Junio C Hamano | d3452a0 | 2008-11-15 08:07:55 | [diff] [blame] | 681 | # Create a local branch from one of the branches just fetched |
| 682 | git checkout -b master FETCH_HEAD |
Junio C Hamano | e9bfa9b | 2007-08-07 06:06:11 | [diff] [blame] | 683 | # Initialize git-svn locally (be sure to use the same URL and -T/-b/-t options as were used on server) |
Junio C Hamano | a476efa | 2008-10-10 15:31:42 | [diff] [blame] | 684 | git svn init http://svn.example.com/project |
Junio C Hamano | e9bfa9b | 2007-08-07 06:06:11 | [diff] [blame] | 685 | # Pull the latest changes from Subversion |
Junio C Hamano | fce7c7e | 2008-07-02 03:06:38 | [diff] [blame] | 686 | git svn rebase |
Junio C Hamano | e9bfa9b | 2007-08-07 06:06:11 | [diff] [blame] | 687 | ------------------------------------------------------------------------ |
| 688 | |
Junio C Hamano | 79770b6 | 2007-01-07 07:43:58 | [diff] [blame] | 689 | REBASE VS. PULL/MERGE |
| 690 | --------------------- |
Junio C Hamano | 6b2cee1 | 2006-08-26 08:43:31 | [diff] [blame] | 691 | |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 692 | Originally, 'git-svn' recommended that the 'remotes/git-svn' branch be |
Junio C Hamano | 79770b6 | 2007-01-07 07:43:58 | [diff] [blame] | 693 | pulled or merged from. This is because the author favored |
Junio C Hamano | fce7c7e | 2008-07-02 03:06:38 | [diff] [blame] | 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. |
Junio C Hamano | 6b2cee1 | 2006-08-26 08:43:31 | [diff] [blame] | 696 | |
Junio C Hamano | fce7c7e | 2008-07-02 03:06:38 | [diff] [blame] | 697 | If you use `git svn set-tree A..B` to commit several diffs and you do |
Junio C Hamano | 79770b6 | 2007-01-07 07:43:58 | [diff] [blame] | 698 | not have the latest remotes/git-svn merged into my-branch, you should |
Junio C Hamano | fce7c7e | 2008-07-02 03:06:38 | [diff] [blame] | 699 | use `git svn rebase` to update your work branch instead of `git pull` or |
Junio C Hamano | 0e88f3e | 2009-06-21 08:03:25 | [diff] [blame] | 700 | `git merge`. `pull`/`merge` can cause non-linear history to be flattened |
Junio C Hamano | 79770b6 | 2007-01-07 07:43:58 | [diff] [blame] | 701 | when committing into SVN, which can lead to merge commits reversing |
| 702 | previous commits in SVN. |
Junio C Hamano | 6b2cee1 | 2006-08-26 08:43:31 | [diff] [blame] | 703 | |
Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 704 | DESIGN PHILOSOPHY |
| 705 | ----------------- |
| 706 | Merge tracking in Subversion is lacking and doing branched development |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 707 | with Subversion can be cumbersome as a result. While 'git-svn' can track |
Junio C Hamano | d2d9ae1 | 2007-09-19 02:27:57 | [diff] [blame] | 708 | copy history (including branches and tags) for repositories adopting a |
| 709 | standard layout, it cannot yet represent merge history that happened |
| 710 | inside git back upstream to SVN users. Therefore it is advised that |
| 711 | users keep history as linear as possible inside git to ease |
| 712 | compatibility with SVN (see the CAVEATS section below). |
Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 713 | |
Junio C Hamano | bdebabb | 2007-08-23 00:25:09 | [diff] [blame] | 714 | CAVEATS |
| 715 | ------- |
| 716 | |
| 717 | For the sake of simplicity and interoperating with a less-capable system |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 718 | (SVN), it is recommended that all 'git-svn' users clone, fetch and dcommit |
| 719 | directly from the SVN server, and avoid all 'git-clone'/'pull'/'merge'/'push' |
Junio C Hamano | bdebabb | 2007-08-23 00:25:09 | [diff] [blame] | 720 | operations between git repositories and branches. The recommended |
| 721 | method of exchanging code between git branches and users is |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 722 | 'git-format-patch' and 'git-am', or just 'dcommit'ing to the SVN repository. |
Junio C Hamano | bdebabb | 2007-08-23 00:25:09 | [diff] [blame] | 723 | |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 724 | Running 'git-merge' or 'git-pull' is NOT recommended on a branch you |
Junio C Hamano | fce7c7e | 2008-07-02 03:06:38 | [diff] [blame] | 725 | plan to 'dcommit' from. Subversion does not represent merges in any |
Junio C Hamano | bdebabb | 2007-08-23 00:25:09 | [diff] [blame] | 726 | reasonable or useful fashion; so users using Subversion cannot see any |
| 727 | merges you've made. Furthermore, if you merge or pull from a git branch |
Junio C Hamano | fce7c7e | 2008-07-02 03:06:38 | [diff] [blame] | 728 | that is a mirror of an SVN branch, 'dcommit' may commit to the wrong |
Junio C Hamano | bdebabb | 2007-08-23 00:25:09 | [diff] [blame] | 729 | branch. |
| 730 | |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 731 | 'git-clone' does not clone branches under the refs/remotes/ hierarchy or |
| 732 | any 'git-svn' metadata, or config. So repositories created and managed with |
| 733 | using 'git-svn' should use 'rsync' for cloning, if cloning is to be done |
Junio C Hamano | bdebabb | 2007-08-23 00:25:09 | [diff] [blame] | 734 | at all. |
| 735 | |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 736 | Since 'dcommit' uses rebase internally, any git branches you 'git-push' to |
Junio C Hamano | fce7c7e | 2008-07-02 03:06:38 | [diff] [blame] | 737 | before 'dcommit' on will require forcing an overwrite of the existing ref |
Junio C Hamano | bdebabb | 2007-08-23 00:25:09 | [diff] [blame] | 738 | on the remote repository. This is generally considered bad practice, |
Junio C Hamano | fce7c7e | 2008-07-02 03:06:38 | [diff] [blame] | 739 | see the linkgit:git-push[1] documentation for details. |
Junio C Hamano | bdebabb | 2007-08-23 00:25:09 | [diff] [blame] | 740 | |
Junio C Hamano | fce7c7e | 2008-07-02 03:06:38 | [diff] [blame] | 741 | Do not use the --amend option of linkgit:git-commit[1] on a change you've |
Junio C Hamano | bdebabb | 2007-08-23 00:25:09 | [diff] [blame] | 742 | already dcommitted. It is considered bad practice to --amend commits |
| 743 | you've already pushed to a remote repository for other users, and |
| 744 | dcommit with SVN is analogous to that. |
| 745 | |
Junio C Hamano | 688eae0 | 2009-06-28 05:19:50 | [diff] [blame^] | 746 | When using multiple --branches or --tags, 'git-svn' does not automatically |
| 747 | handle name collisions (for example, if two branches from different paths have |
| 748 | the same name, or if a branch and a tag have the same name). In these cases, |
| 749 | use 'init' to set up your git repository then, before your first 'fetch', edit |
| 750 | the .git/config file so that the branches and tags are associated with |
| 751 | different name spaces. For example: |
| 752 | |
| 753 | branches = stable/*:refs/remotes/svn/stable/* |
| 754 | branches = debug/*:refs/remotes/svn/debug/* |
| 755 | |
Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 756 | BUGS |
| 757 | ---- |
Junio C Hamano | 43d0134 | 2006-10-12 04:07:32 | [diff] [blame] | 758 | |
Junio C Hamano | 00cb371 | 2007-02-23 11:13:52 | [diff] [blame] | 759 | We ignore all SVN properties except svn:executable. Any unhandled |
| 760 | properties are logged to $GIT_DIR/svn/<refname>/unhandled.log |
Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 761 | |
Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 762 | Renamed and copied directories are not detected by git and hence not |
| 763 | tracked when committing to SVN. I do not plan on adding support for |
| 764 | this as it's quite difficult and time-consuming to get working for all |
Junio C Hamano | 00cb371 | 2007-02-23 11:13:52 | [diff] [blame] | 765 | the possible corner cases (git doesn't do it, either). Committing |
| 766 | renamed and copied files are fully supported if they're similar enough |
| 767 | for git to detect them. |
| 768 | |
| 769 | CONFIGURATION |
| 770 | ------------- |
| 771 | |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 772 | 'git-svn' stores [svn-remote] configuration information in the |
Junio C Hamano | 00cb371 | 2007-02-23 11:13:52 | [diff] [blame] | 773 | repository .git/config file. It is similar the core git |
| 774 | [remote] sections except 'fetch' keys do not accept glob |
| 775 | arguments; but they are instead handled by the 'branches' |
| 776 | and 'tags' keys. Since some SVN repositories are oddly |
| 777 | configured with multiple projects glob expansions such those |
| 778 | listed below are allowed: |
| 779 | |
| 780 | ------------------------------------------------------------------------ |
| 781 | [svn-remote "project-a"] |
| 782 | url = http://server.org/svn |
Junio C Hamano | 9572e92 | 2009-04-02 06:52:03 | [diff] [blame] | 783 | fetch = trunk/project-a:refs/remotes/project-a/trunk |
Junio C Hamano | 00cb371 | 2007-02-23 11:13:52 | [diff] [blame] | 784 | branches = branches/*/project-a:refs/remotes/project-a/branches/* |
| 785 | tags = tags/*/project-a:refs/remotes/project-a/tags/* |
Junio C Hamano | 00cb371 | 2007-02-23 11:13:52 | [diff] [blame] | 786 | ------------------------------------------------------------------------ |
| 787 | |
Junio C Hamano | 0773834 | 2009-04-23 03:06:56 | [diff] [blame] | 788 | Keep in mind that the '\*' (asterisk) wildcard of the local ref |
Junio C Hamano | 7d9e9bd | 2007-08-29 07:31:47 | [diff] [blame] | 789 | (right of the ':') *must* be the farthest right path component; |
Junio C Hamano | 0773834 | 2009-04-23 03:06:56 | [diff] [blame] | 790 | however the remote wildcard may be anywhere as long as it's an |
Junio C Hamano | a638742 | 2007-08-25 03:54:27 | [diff] [blame] | 791 | independent path component (surrounded by '/' or EOL). This |
Junio C Hamano | 00cb371 | 2007-02-23 11:13:52 | [diff] [blame] | 792 | type of configuration is not automatically created by 'init' and |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 793 | should be manually entered with a text-editor or using 'git-config'. |
Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 794 | |
Junio C Hamano | 6b2cee1 | 2006-08-26 08:43:31 | [diff] [blame] | 795 | SEE ALSO |
| 796 | -------- |
Junio C Hamano | 35738e8 | 2008-01-07 07:55:46 | [diff] [blame] | 797 | linkgit:git-rebase[1] |
Junio C Hamano | 6b2cee1 | 2006-08-26 08:43:31 | [diff] [blame] | 798 | |
Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 799 | Author |
| 800 | ------ |
| 801 | Written by Eric Wong <normalperson@yhbt.net>. |
| 802 | |
| 803 | Documentation |
| 804 | ------------- |
| 805 | Written by Eric Wong <normalperson@yhbt.net>. |