git-svn --ignore-paths

后端 未结 7 1585
悲哀的现实
悲哀的现实 2021-02-01 04:27

I\'m struggling for a number of hours now with the --ignore-paths option to git-svn, in an attempt to fetch only certain tags from a large repository.

I want to start

7条回答
  •  不思量自难忘°
    2021-02-01 04:49

    I have a similar problem and a partial Solution for my case .. .

    Context :
    We have only one SVN repository for Meca, Hardware, Software team... the repository is a complete mess.. so I try to use regex to reduce the area to scan. After 1 day I just gave up.

    Finally I used the include-path option to scan only folder with "*Src*" inside. which speed up the scan. also use the option :
    -r to reduce the history size you will get in local.
    --no-minimize-url otherwise git-svn will scan the whole repository even if you specify the trunk and branch location.

    git svn clone 
    -r11213:HEAD 
    --prefix svn/
    --no-minimize-url
    --trunk=/trunk/dev/SW/Code/Controller1
    --branches=/branches/SW_team/
    --include-paths=.*Src.*
    https://svnserver.compagny.com/Project1/
    Controller1__git__
    

    notice that right now i do not care of the Tags.

    Hope it could help, even It's not the original question (5 years ago :-) )


    EDIT: I cannot add a comment so I comment the question here (not enough reputation point)

    1) --ignore-paths can be given for git svn [init/fetch or clone] (i do not know if there is a different behavior)
    2) --ignore-paths expect a regex , be carefull the "." means any character. By chance the carater "." is also any character so regex=Acme-5.0 will match string="Acme-5.0" but also string="Acme-580", it should work anyway.

提交回复
热议问题