← 返回命令列表

Linux command

git-svn 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Clone SVN repository

git svn clone [svn://server/repo]

Clone with standard layout

git svn clone -s [svn://server/repo]

Clone with author mapping

git svn clone -s --authors-file=[authors.txt] [svn://server/repo]

Fetch SVN changes

git svn fetch

Rebase on SVN

git svn rebase

Commit to SVN

git svn dcommit

说明

git svn provides bidirectional operation between Git and Subversion repositories. It allows developers to use Git locally while working with an SVN server, enabling full Git workflows for teams still using Subversion. The command clones SVN repos into Git, syncs changes in both directions, and maps SVN's trunk/branches/tags structure to Git branches.

参数

clone _URL_
Clone SVN repository.
fetch
Fetch from SVN.
rebase
Rebase on SVN commits.
dcommit
Push commits to SVN.
log
Show SVN-style log output.
info
Show information about a file or directory similar to svn info.
branch _name_
Create a new branch in SVN.
create-ignore
Create .gitignore files from svn:ignore properties.
show-ignore
Print svn:ignore properties to stdout.
reset -r _revision_
Undo effects of fetch back to the specified revision.
-s, --stdlayout
Standard trunk/branches/tags layout.
-T _PATH_
Trunk path.
-b _PATH_
Branches path.
-t _PATH_
Tags path.
--authors-file _FILE_
Map SVN usernames to Git authors.
--prefix _PREFIX_
Prefix for SVN remote ref names.
-r _ARG_, --revision _ARG_
Specify SVN revision (or range) to operate on.
--ignore-paths _REGEX_
Perl regex of paths to skip during fetch.

FAQ

What is the git-svn command used for?

git svn provides bidirectional operation between Git and Subversion repositories. It allows developers to use Git locally while working with an SVN server, enabling full Git workflows for teams still using Subversion. The command clones SVN repos into Git, syncs changes in both directions, and maps SVN's trunk/branches/tags structure to Git branches.

How do I run a basic git-svn example?

Run `git svn clone [svn://server/repo]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does clone _URL_ do in git-svn?

Clone SVN repository.