GIT-SVN(1) Git Manual GIT-SVN(1) (NAME) git-svn - (SYNOPSIS) git svn [] [] (DESCRIPTION) git svn (changeset) . . git svn --stdlayout "trunk/branches/tags" . -T/-t/-b ( init clone ). ( ) fetch dcommit . (COMMANDS) init () git svn . (URL) URL -T/-t/-b . . . -T, --trunk=, -t, --tags=, -b, --branches=, -s, --stdlayout init . (--tags=project/tags) URL (--tags=https://foo.org/project/tags) . --tags / --branches . --stdlayout trunk tags branches . . --no-metadata noMetadata [svn-remote] . svn.noMetadata . --use-svm-props useSvmProps [svn-remote] . --use-svnsync-props useSvnsyncProps [svn-remote] . --rewrite-root= rewriteRoot [svn-remote] . --rewrite-uuid= rewriteUUID [svn-remote] . --username= SVN ( http https svn ) . ( svn+ssh://) URL : svn+ssh://foo@svn.bar.com/project --prefix= trunk/branches/tags . . --branches/-b . ( ) SVN "refs/remotes/$prefix/*" (refs/remotes/$remote/*) . . origin/ . . "" ( ) . SVN "refs/remotes/*" . --prefix "" ( Getopt::Long . --prefix="" ). --ignore-refs= (regex) init clone . --ignore-refs fetch . --ignore-paths= init clone . --ignore-paths fetch . --include-paths= init clone . --include-paths fetch . --no-minimize-url ( --stdlayout --branches --tags) git svn ( ) . . --no-minimize-url git svn URL . URL/ ( ). fetch Subversion . [svn-remote "..."] $GIT_DIR/config . rev_map ( $GIT_DIR/svn/**/.rev_map.* FILES ). --localtime Git UTC . git log ( --date=local) svn log . Subversion Git Git . --parent SVN HEAD . --ignore-refs= (ref) Perl . << >> (negative look-ahead assertion) ^refs/remotes/origin/(?!tags/wanted-tag|wanted-branch).*$ ref . config key: svn-remote..ignore-refs ignore-refs . --ignore-paths= Perl (checkout) SVN . --ignore-paths fetch ( clone dcommit rebase ) . config key: svn-remote..ignore-paths ignore-paths . : "doc*" --ignore-paths="^doc" "branches" "tags" --ignore-paths="^[^/]+/(?:branches|tags)" --include-paths= Perl (checkout) SVN . --include-paths fetch ( clone dcommit rebase ) . --ignore-paths --include-paths . config key: svn-remote..include-paths --log-window-size= Subversion . 100 . Subversion clone/fetch . (timeout) . clone init fetch . (basename) URL . init fetch --fetch-all --parent. fetch (working tree) rebase . --preserve-empty-dirs Subversion (placeholder) Git . Subversion ( ). . --placeholder-filename= --preserve-empty-dirs . : ".gitignore" rebase SVN HEAD ( SVN) (rebase) . svn update git pull dcommit git svn git rebase git merge . git svn fetch git rebase . --fetch-all [svn-remote] [svn-remote]. git rebase . rev_map ( $GIT_DIR/svn/**/.rev_map.* FILES ). -l, --local git rebase SVN . dcommit diff () SVN rebase reset ( SVN head ). Git (revision) SVN . Git ( Git) . dcommit set-tree ( ) . --no-rebase rebase reset . --commit-url (URL) ( ) . git svn ( svn:// http:// ) ( svn+ssh:// https://) . config key: svn-remote..commiturl config key: svn.commiturl (overwrites all svn-remote..commiturl options) (URL) commiturl SVN . SVN svn-remote..pushurl . ( ) . --mergeinfo= (merge) dcommit ( --mergeinfo="/branches/foo:1-10"). svn ( property) svn 1.5 . (--mergeinfo="/branches/foo:1-10 /branches/bar:3,5-6,8"). config key: svn.pushmergeinfo git-svn svn:mergeinfo SVN . dcommit (non-fast-forward) SVN (push) . --interactive (patch set) SVN . "yes" ( ) "no" ( ) "all" ( ) "quit" . "no" "quit" git svn dcommit SVN . branch SVN . -m, --message . -t, --tag tags_subdir branches_subdir git svn init . -d, --destination= --branches ( --tags) init clone ( ) SVN . refspec . refspec : git config --get-all svn-remote..branches git config --get-all svn-remote..tags SVN -R init ( "svn"). --username SVN . username . --commit-url (URL) . SVN . commiturl . git config --get-all svn-remote..commiturl --parents . --parents svn cp . tag SVN . branch -t . log svn ( svn log) svn -r/--revision . `svn log' : -r [:], --revision=[:] : HEAD NEXT BASE PREV ... -v, --verbose --verbose svn log . --limit= --max-count / --incremental : --show-commit sha1 Git --oneline --pretty=oneline SVN UTC . svn UTC ( TZ=) . . git log . blame (revision) . `svn blame' . SVN blame HEAD () . git blame . --git-format git blame SVN Git . SVN ( ) 0 . find-rev SVN rN Git ( (tree-ish) ). SVN . -B, --before SVN SVN ( ) . -A, --after SVN . set-tree dcommit . SVN . (fetch) . SVN . git svn . create-ignore svn:ignore svn:global-ignores .gitignore . (stage) . -r/--revision . show-ignore svn:ignore svn:global-ignores . $GIT_COMMON_DIR/info/exclude . mkdirs $GIT_DIR/svn//unhandled.log (core Git) . "git svn clone" "git svn rebase" "mkdirs" "git checkout" "git reset" . ( svn-remote..automkdirs .) commit-diff (diff) (tree-ish) . git svn init . : () () () (URL) Subversion. git svn ( git svn ) (URL) . -r . -m -F ( --edit ). -m , --message= msg . --edit . -F , --file= . --edit . info `svn info' . -r/--revision . URL: --url . proplist (properties) Subversion . Subversion -r/--revision . propget Subversion . -r/--revision . propset Subversion . : git svn propset svn:keywords "FreeBSD=%H" devel/py-tipper/Makefile svn:keywords devel/py-tipper/Makefile FreeBSD=%H . show-externals (externals) Subversion . -r/--revision . gc $GIT_DIR/svn//unhandled.log $GIT_DIR/svn//index . reset fetch . SVN fetch . SVN reset . SVN --ignore-paths fetch "not found in commit" ( ) "checksum mismatch" ( ) . ( --ignore-paths) reset . rev_map refs/remotes/git-svn ( $GIT_DIR/svn/**/.rev_map.* (FILES) ). reset fetch git reset git rebase . -r , --revision= . . -p, --parent . : "master" "r2" . r1---r2---r3 remotes/git-svn \ A---B master ignore-paths SVN "r2" . : git svn reset -r2 -p git svn fetch r1---r2'--r3' remotes/git-svn \ r2---r3---A---B master "master" git rebase . git merge dcommit ! git rebase --onto remotes/git-svn A^ master r1---r2'--r3' remotes/git-svn \ A'--B' master (OPTIONS) --shared[=(false|true|umask|group|all|world|everybody)], --template= init . git init . -r , --revision fetch . (revision ranges) / . $NUMBER $NUMBER1:$NUMBER2 ( ) $NUMBER:HEAD BASE:$NUMBER . (fetch) (mirror) . -, --stdin set-tree . (stdin) . sha1 git rev-list --pretty=oneline . --rmdir dcommit set-tree commit-diff . SVN . SVN . . SVN . config key: svn.rmdir -e, --edit dcommit set-tree commit-diff . SVN . (tree objects) . config key: svn.edit -l, --find-copies-harder dcommit set-tree commit-diff . git diff-tree git-diff-tree(1) . config key: svn.l config key: svn.findcopiesharder -A, --authors-file= git cvsimport <> : loginname = Joe User git svn SVN authors-file git svn . . git svn authors-file . config key: svn.authorsfile --authors-prog= SVN . "Name " "Name <>" . filename init clone fetch . filename $PATH . config key: svn.authorsProg -q, --quiet git svn . . -m, --merge, -s, --strategy=, -p, --rebase-merges dcommit rebase . dcommit git reset git rebase ( dcommit ). -n, --dry-run dcommit rebase branch tag . dcommit Git diff SVN . rebase svn URL svn . branch tag URL . --use-log-author svn Git ( fetch rebase dcommit) From: () Signed-off-by . config key: svn.useLogAuthor --add-author-from Git svn ( set-tree dcommit) From: Signed-off-by From: Git . --use-log-author . config key: svn.addAuthorFrom (ADVANCED OPTIONS) -i, --id GIT_SVN_ID ( ). (refname) URL . log dcommit . -R, --svn-remote [svn-remote ""] SVN . : "svn" --follow-parent ( --trunk --tags --branches --stdlayout). Git . . git svn . . --no-follow-parent . config key: svn.followparent -- (CONFIG FILE-ONLY OPTIONS) svn.noMetadata, svn-remote..noMetadata git-svn-id: . git svn . $GIT_DIR/svn/**/.rev_map.* git svn . git svn log . () useSvmProps . SVN . SVN Git SVN git-filter-repo[1] . filter-repo "svn.authorsFile" . svn.useSvmProps, svn-remote..useSvmProps git svn URL UUID SVN::Mirror ( svk) . SVN "svm:headrev" SVN::Mirror ( SVK ) . (UUID) . URL URL UUID . svn.useSvnsyncProps, svn-remote..useSvnsyncprops useSvmProps svnsync(1) SVN 1.4.x . svn-remote..rewriteRoot URL . git svn ( file://) URL http:// svn:// URL . svn-remote..rewriteUUID useSvmProps UUID . UUID useSvmProps useSvnsyncProps . svn-remote..pushurl remote..pushurl Git url SVN / . . commiturl pushurl . commiturl pushurl commiturl . svn.brokenSymlinkWorkaround SVN . SVN blob "false" . git svn . git svn "true" . svn.pathnameencoding git svn . utf8 ASCII . Encode . svn-remote..automkdirs "git svn clone" "git svn rebase" Subversion . "false" "git svn mkdirs" . git svn "true" . noMetadata rewriteRoot rewriteUUID useSvnsyncProps useSvmProps git svn . svn-remote git-svn-id: rewriteRoot rewriteUUID . (BASIC EXAMPLES) (trunk) Subversion ( ): # Clone a repo (like git clone): git svn clone http://svn.example.com/project/trunk # Enter the newly cloned directory: cd trunk # You should be on master branch, double-check with 'git branch' git branch # Do some work and commit locally to Git: git commit ... # Something is committed to SVN, rebase your local changes against the # latest changes in SVN: git svn rebase # Now commit your changes (that were committed previously using Git) to SVN, # as well as automatically updating your working HEAD: git svn dcommit # Append svn:ignore and svn:global-ignores settings to the default Git exclude file: git svn show-ignore >> .git/info/exclude Subversion ( ): # Clone a repo with standard SVN directory layout (like git clone): git svn clone http://svn.example.com/project --stdlayout --prefix svn/ # Or, if the repo uses a non-standard directory layout: git svn clone http://svn.example.com/project -T tr -b branch -t tag --prefix svn/ # View all branches and tags you have cloned: git branch -r # Create a new branch in SVN git svn branch waldo # Reset your master to trunk (or any other branch, replacing 'trunk' # with the appropriate name): git reset --hard svn/trunk # You may only dcommit to one branch/tag/trunk at a time. The usage # of dcommit/rebase/show-ignore should be the same as above. git svn clone ( Subversion). ( ) git svn Subversion git svn clone git clone : # Do the initial import on a server ssh server "cd /pub && git svn clone http://svn.example.com/project [options...]" # Clone locally - make sure the refs/remotes/ space matches the server mkdir project cd project git init git remote add origin server:/pub/project git config --replace-all remote.origin.fetch '+refs/remotes/*:refs/remotes/*' git fetch # Prevent fetch/pull from remote Git server in the future, # we only want to use git svn for future updates git config --remove-section remote.origin # Create a local branch from one of the branches just fetched git checkout -b master FETCH_HEAD # Initialize 'git svn' locally (be sure to use the same URL and # --stdlayout/-T/-b/-t/--prefix options as were used on server) git svn init http://svn.example.com/project [options...] # Pull the latest changes from Subversion git svn rebase / (REBASE VS. PULL/MERGE) git svn git pull git merge git svn rebase git rebase . SVN git svn dcommit SVN . git svn git svn pull merge . git svn set-tree B (head) git svn set-tree A..B . git pull git merge git svn set-tree A..B SVN (flatten ) SVN . (MERGE TRACKING) git svn ( ) SVN . SVN ( << >> ). (HANDLING OF SVN BRANCHES) git svn ( --follow-branches ) SVN branchname@nnn ( nnn SVN ) . git svn SVN . SVN . git svn SVN . SVN . . SVN git svn ( --revision ) SVN git svn ( ). git svn SVN . <>> . @ SVN . . SVN @ . SVN . : SVN trunk/tags/branches trunk/sub r.100 . r.200 trunk/sub branches/ . git svn clone -s sub . r.100 r.199 sub . r.100 r.199 ( trunk/ trunk/sub/). sub@200 sub ( r.200 trunk/sub/) . (CAVEATS) Subversion git svn clone fetch dcommit SVN git clone/pull/merge/push . git format-patch git am 'dcommit' SVN . git merge git pull dcommit <<>> Subversion . SVN merge pull dcommit . : git svn dcommit SVN : git log --grep=^git-svn-id: --first-parent -1 dcommit (first parent) . SVN . git clone refs/remotes/ git svn . git svn rsync . dcommit rebase dcommit git push (force) . git-push(1) . --amend git-commit(1) dcommit . --amend push dcommit SVN . SVN (--trunk --tags --branches --stdlayout) git svn clone . trunk . (trunk/branches/tags) --stdlayout . / ( trunk) . --trunk / --branches / --tags . --branches --tags git svn ( ). init fetch $GIT_DIR/config (namespaces) . : branches = stable/*:refs/remotes/svn/stable/* branches = debug/*:refs/remotes/svn/debug/* (CONFIGURATION) git svn [svn-remote] $GIT_DIR/config . [remote] fetch (glob) branches tags . SVN glob : [svn-remote "project-a"] url = http://server.org/svn fetch = trunk/project-a:refs/remotes/project-a/trunk branches = branches/*/project-a:refs/remotes/project-a/branches/* branches = branches/release_*:refs/remotes/project-a/branches/release_* branches = branches/re*se:refs/remotes/project-a/branches/* tags = tags/*/project-a:refs/remotes/project-a/tags/* * () ( :) ( / ). init git config . . : branches = branches/re*se:refs/remotes/project-a/branches/* release rese re123se branches = branches/re*s*e:refs/remotes/project-a/branches/* . . : [svn-remote "huge-project"] url = http://server.org/svn fetch = trunk/src:refs/remotes/trunk branches = branches/{red,green}/src:refs/remotes/project-a/branches/* tags = tags/{1.0,2.0}/src:refs/remotes/project-a/tags/* fetch branches tags : [svn-remote "messy-repo"] url = http://server.org/svn fetch = trunk/project-a:refs/remotes/project-a/trunk fetch = branches/demos/june-project-a-demo:refs/remotes/project-a/demos/june-demo branches = branches/server/*:refs/remotes/project-a/branches/* branches = branches/demos/2011/*:refs/remotes/project-a/2011-demos/* tags = tags/server/*:refs/remotes/project-a/tags/* -d --destination : $ git svn branch -d branches/server release-2-3-0 git-svn . $GIT_DIR/svn/.metadata branches-maxRev / tags-maxRev ( ) . (FILES) $GIT_DIR/svn/**/.rev_map.* Subversion Git. noMetadata git-svn-id: ( svn.noMetadata ). git svn fetch git svn rebase rev_map . git svn reset . (BUGS) SVN svn:executable . $GIT_DIR/svn//unhandled.log . Git SVN . (corner cases) ( ). Git . SVN ( ) ( ). SVN git svn . SVN tags/ . (SEE ALSO) git-rebase(1) (GIT) git(1) (NOTES) 1. git-filter-repo https://github.com/newren/git-filter-repo Git 2.55.0 2026-06-29 GIT-SVN(1)