简体   繁体   English

如何使用git svn配置svn ignore设置?

[英]How to configure svn ignore settings with git svn?

I know I can configure folders and files for being ignored by subversion using the following commands: 我知道我可以使用以下命令配置文件夹和文件以便被subversion忽略:

svn propset svn:ignore build . // Ignores the build folder.
svn propedit svn:ignore . // Opens an editor.

Though, I use git svn to checkout a repository stored on a subversion server. 虽然,我使用git svn来检查存储在subversion服务器上的存储库。 I could not find a command to do the configuration this way. 我找不到以这种方式进行配置的命令。 The following list shows all commands that are suggested by zsh completion for git svn : 以下列表显示了git svn zsh完成建议的所有命令:

$ git svn
blame           -- show what revision and author last modified each line of a file:
branch          -- create a branch in the SVN repository
clone           -- same as init, followed by fetch
commit-diff     -- commit diff of two tree-ishs
create-ignore   -- recursively finds the svn:ignore property and creates .gitignore files
dcommit         -- commit diffs from given head onto SVN repository
fetch           -- fetch revisions from the SVN remote
find-rev        -- output git commit corresponding to the given SVN revision's hash
info            -- show information about a file or directory
init            -- initialize an empty git repository with additional svn data
log             -- output SVN log-messages
propget         -- get a given SVN property for a file
proplist        -- list the SVN properties stored for a file or directory
rebase          -- fetch revs from SVN parent of HEAD and rebase current work on it
set-tree        -- commit given commit or tree to SVN repository
show-externals  -- show the subversion externals
show-ignore     -- output corresponding toplevel .gitignore file of svn:ignore
tag             -- create a tag in the SVN repository

Question: 题:

  • Do you know if there is any way to edit the subversion ignore configuration via git svn ? 你知道是否有办法通过git svn编辑subversion ignore配置?

No, git-svn supports only creation of .gitignore by svn:ignore. 不,git-svn仅支持通过svn:ignore创建.gitignore。 To set svn:ignore you may 设置svn:忽略你可能

  1. Use svn propset svn:ignore 'value' URL where URL can be obtained by ( git-svn git svn info path/to/directory | awk '/URL:/{print $2}' ) So you may write your own 'svn_propset.sh' script. 使用svn propset svn:ignore 'value' URL ,其中URL可以通过( git-svn git svn info path/to/directory | awk '/URL:/{print $2}' )所以你可以编写自己的'svn_propset。 sh'脚本。 To sync your .gitignore with svn:ignore run git svn create-ignore 要将.gitignore与svn同步:ignore run git svn create-ignore

  2. Use any of tools that allow .gitignore <-> svn:ignore translation. 使用允许.gitignore < - > svn:忽略翻译的任何工具。 I know only two: SmartGit (client side, note: you need a fresh clone to turn ignores support on) and SubGit (server side, you need to have access to the server with SVN). 我只知道两个: SmartGit (客户端,注意:你需要一个新的克隆来忽略支持)和SubGit (服务器端,你需要访问带有SVN的服务器)。 In this case svn:ignore is set on pushing your local commit to the SVN(for SmartGit)/Git(for SubGit) repository. 在这种情况下,svn:ignore是在将本地提交推送到SVN(对于SmartGit)/ Git(对于SubGit)存储库时设置的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM