2

We have a large svn repository that locally we use git and git-svn to interact with.

Recently I created a repository but ignored a file starting with trunk. I fixed the ignore-paths so it ignores the directory trunk and not any file starting with trunk.

Now I get the git svn "was not found in commit" error since the commits git syncs with have the file but git is missing the original file commit.

Usually one would use git svn reset -rxxxx and git fetch -rxxxx but this is a two year old repository and I can not roll back to when the file was originally created.

How do I get git to pull the file down from svn?

4

2 回答 2

1

Idea 1:

Create a svn working copy. Then:

svn rm <paths which you want un-ignore>
svn commit -m "ignore workaround"
svn merge -r COMMITTED:PREV .
svn commit -m "Reverting: ignore workaround"

Then just edit your .git/config to amend the ignore-paths and then git svn rebase.

Idea 2:

just copy all files manually into the git repo from svn repo, commit them and ditch the svn.

Idea 3:

Don't worry and reset the two year old git repo.

于 2013-05-08T21:59:36.107 回答
0

One solution would be to:

  • Update to latest revision git svn rebase
  • Copy the files manually (remove them from .git/info/exclude if any)
  • Add them and commit using git commit
  • Commit them using git svn dcommit

That should result in an error like:

ERROR from SVN: RA layer file already exists: File X already exists W: 9166d48381296ed6038baf09425a6e6d84638c8c and refs/remotes/git-svn differ, using rebase: :040000 000000 2ffb637dfc63727c4108c41c705a45e673e5dcbc 0000000000000000000000000000000000000000 D folder Current branch master is up to date. ERROR: Not all changes have been committed into SVN, however the committed ones (if any) seem to be successfully integrated into the working tree. Please see the above messages for details.

The git commit commit would exist, but the git svn dcommit would not in upstream svn repository (i.e. nothing will happen, fugazi, fairy dust, it doesn't exist).

于 2014-04-11T12:05:49.393 回答