问题
I'm using SubGit to clone a SVN repository. Somewhere along the revisions is a copy of "/" to a certain tag. When SubGit loads every revision, it takes a long time to get this certain tag, which happens to be a copy of "/". This prevents the copy from being made.
I have tried setting a minimalRevision, but I need revisions before and after the copy of "/". SubGit is able to get revisions before or revisions after that, but not all revisions and excluding this certain revision.
Is there a way to exclude certain SVN revisions while installing a SubGit repository ?
I have no admin access to the SVN server in order to delete this revision.
回答1:
I encountered the same problem and here is how I skip some revisions. I am using SubGit 3.2.4.
- Run
subgit import
. - When encounter a revision which takes a long time, press
Ctrl
+C
to stop the import. - Open the text file at
<GIT_REPO>/svn/.metadata
, where<GIT_REPO>
is the path to the imported Git repository. - Modify the settings
branches-maxRev
andtags-maxRev
to the largest sequential revision number to want to skip. For example, if the values ofbranches-maxRev
andtags-maxRev
is17761
and you want to skip revision17762
and17763
, change the value to17763
. - Run
subgit import
again to resume import.
回答2:
From what I can see there is no way of excluding revisions from SubGit. However, there might be a different way of avoiding including the "copies of everything" in the import. If you know what svn path the copy was made to, e.g. tags/tag-of-root
, you can exclude this by adding this to the <git-project>/subgit/config
file:
excludeBranches = tags/tag-of-root
This means the tag will be excluded. The only drawback is that if a correct tag was later created with the same now, this tag will also be excluded. However, it's still the best option I've found, as the solution added by VCD doesn't work for me.
I've had to interrupt and restart (from scratch) my import four times so far, each time adding another excludeBranches config line, but the import is also getting a lot faster every time!
EDIT: I think the reason VCD's suggested workaround doesn't work for me is that the creation of the broken tag and its deletion are not in consecutive revisions, but rather with several days and many revisions between. Hence it's not possible for me to skip both the creation and deletion of the broken tag in one go, causing inconsistency where the deletion references a tag that hasn't been added (if I exclude the creation).
来源:https://stackoverflow.com/questions/18918215/skip-revisions-when-installing-subgit-repository