我已经有一个现有的 git-svn 存储库,其 .config 文件中的忽略路径如下所示:
ignore-paths = ^(?!(Path1/Proj1|Path1/Proj2|Path2/Proj3))
这很有效。
有人在 svn 中添加了一个新项目,我现在在 git 存储库中需要它。
如果我将忽略路径更改为下面的内容并发出获取或 rebase ,我永远不会看到 Path2/Proj4
ignore-paths = ^(?!(Path1/Proj1|Path1/Proj2|Path2/Proj3|Path2/Proj4))
过去,我总是放弃并删除我的 git 存储库并重新创建它。有更好的办法吗?
最佳答案
编辑忽略路径后,您需要
git svn reset -r <n> -p # where <n> is the SVN revision where the new path was added.
git svn fetch
git rebase # or reset
引用git-svn(1)
:
reset
Undoes the effects of fetch back to the specified revision. This allows you to re-fetch an SVN revision. Normally the contents of an SVN revision should never change and reset should not be necessary. However, if SVN permissions change, or if you alter your --ignore-paths option, a fetch may fail with "not found in commit" (file not previously visible) or "checksum mismatch" (missed a modification). If the problem file cannot be ignored forever (with --ignore-paths) the only way to repair the repo is to use reset.
Only the rev_map and refs/remotes/git-svn are changed (see $GIT_DIR/svn/*\*/.rev_map.* in the FILES section below for details). Follow reset with a fetch and then git reset or git rebase to move local branches onto the new tree.
关于git-svn - 如何更改现有 git-svn 存储库上的忽略路径?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12588564/