When importing tag, GIT downloads again full commit history



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















We have an SVN repository with almost 190k commits. Locally I have created a GIT repository in order to work more comfortably.



When I have to update my local GIT repository and fetch the new commits to the SVN repository, I use this combination of commands:



!git svn fetch && git svn rebase -l && git push . remotes/trunk:master && git push -f origin master



(found here: https://lostechies.com/keithdahlby/2010/11/29/git-svn-aliases-git-up-and-git-dci/)



Everything works smoothly, except when someone created a tag in the SVN repository: in that case git-svn will download full history for that tag (from revision 1 to the last one), which means that the sync, instead of taking a couple of minutes, will take 10-15 hours.



Could all this be avoided? Maybe the command I'm using is not the right one?



Thanks!










share|improve this question

















  • 1





    git and subversion tags are substantially different. As far as I know - you cannot avoid this.

    – fredrik
    Nov 15 '18 at 8:22

















0















We have an SVN repository with almost 190k commits. Locally I have created a GIT repository in order to work more comfortably.



When I have to update my local GIT repository and fetch the new commits to the SVN repository, I use this combination of commands:



!git svn fetch && git svn rebase -l && git push . remotes/trunk:master && git push -f origin master



(found here: https://lostechies.com/keithdahlby/2010/11/29/git-svn-aliases-git-up-and-git-dci/)



Everything works smoothly, except when someone created a tag in the SVN repository: in that case git-svn will download full history for that tag (from revision 1 to the last one), which means that the sync, instead of taking a couple of minutes, will take 10-15 hours.



Could all this be avoided? Maybe the command I'm using is not the right one?



Thanks!










share|improve this question

















  • 1





    git and subversion tags are substantially different. As far as I know - you cannot avoid this.

    – fredrik
    Nov 15 '18 at 8:22













0












0








0








We have an SVN repository with almost 190k commits. Locally I have created a GIT repository in order to work more comfortably.



When I have to update my local GIT repository and fetch the new commits to the SVN repository, I use this combination of commands:



!git svn fetch && git svn rebase -l && git push . remotes/trunk:master && git push -f origin master



(found here: https://lostechies.com/keithdahlby/2010/11/29/git-svn-aliases-git-up-and-git-dci/)



Everything works smoothly, except when someone created a tag in the SVN repository: in that case git-svn will download full history for that tag (from revision 1 to the last one), which means that the sync, instead of taking a couple of minutes, will take 10-15 hours.



Could all this be avoided? Maybe the command I'm using is not the right one?



Thanks!










share|improve this question














We have an SVN repository with almost 190k commits. Locally I have created a GIT repository in order to work more comfortably.



When I have to update my local GIT repository and fetch the new commits to the SVN repository, I use this combination of commands:



!git svn fetch && git svn rebase -l && git push . remotes/trunk:master && git push -f origin master



(found here: https://lostechies.com/keithdahlby/2010/11/29/git-svn-aliases-git-up-and-git-dci/)



Everything works smoothly, except when someone created a tag in the SVN repository: in that case git-svn will download full history for that tag (from revision 1 to the last one), which means that the sync, instead of taking a couple of minutes, will take 10-15 hours.



Could all this be avoided? Maybe the command I'm using is not the right one?



Thanks!







git git-svn






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 15 '18 at 8:08









user1527576user1527576

18519




18519







  • 1





    git and subversion tags are substantially different. As far as I know - you cannot avoid this.

    – fredrik
    Nov 15 '18 at 8:22












  • 1





    git and subversion tags are substantially different. As far as I know - you cannot avoid this.

    – fredrik
    Nov 15 '18 at 8:22







1




1





git and subversion tags are substantially different. As far as I know - you cannot avoid this.

– fredrik
Nov 15 '18 at 8:22





git and subversion tags are substantially different. As far as I know - you cannot avoid this.

– fredrik
Nov 15 '18 at 8:22












1 Answer
1






active

oldest

votes


















0














If you fetch multiple branches/tags from SVN then, by default, git svn tries to connect these to the last common ancestor. Finding this ancestor can be very expensive -- sometimes git svn will reread the complete history of the repository.



On the other hand your alias seems to be concerned only about trunk ignoring any tags and branches. Given this situation you have several options with varying consequences:



  1. Setup your git repository for exactly one branch. Do not use the options -s or --stdlayout. Obviously you will only sync a certain part of the SVN repo.


  2. Use the option --no-follow-parent (and look at the section Handling of SVN branches for more explanation). In this case you can track multiple branches/tags but the history of a new tag/branch will not be connected to its ancestor.


  3. In some situations git svn tries to reread the history from r0 up to HEAD. It does so with 100 revisions per chunk which can be very slow for large/old repos. In this case you can try to speed things up using the option --log-window-size=3000 for git svn fetch (See doc here).






share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53314904%2fwhen-importing-tag-git-downloads-again-full-commit-history%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    If you fetch multiple branches/tags from SVN then, by default, git svn tries to connect these to the last common ancestor. Finding this ancestor can be very expensive -- sometimes git svn will reread the complete history of the repository.



    On the other hand your alias seems to be concerned only about trunk ignoring any tags and branches. Given this situation you have several options with varying consequences:



    1. Setup your git repository for exactly one branch. Do not use the options -s or --stdlayout. Obviously you will only sync a certain part of the SVN repo.


    2. Use the option --no-follow-parent (and look at the section Handling of SVN branches for more explanation). In this case you can track multiple branches/tags but the history of a new tag/branch will not be connected to its ancestor.


    3. In some situations git svn tries to reread the history from r0 up to HEAD. It does so with 100 revisions per chunk which can be very slow for large/old repos. In this case you can try to speed things up using the option --log-window-size=3000 for git svn fetch (See doc here).






    share|improve this answer



























      0














      If you fetch multiple branches/tags from SVN then, by default, git svn tries to connect these to the last common ancestor. Finding this ancestor can be very expensive -- sometimes git svn will reread the complete history of the repository.



      On the other hand your alias seems to be concerned only about trunk ignoring any tags and branches. Given this situation you have several options with varying consequences:



      1. Setup your git repository for exactly one branch. Do not use the options -s or --stdlayout. Obviously you will only sync a certain part of the SVN repo.


      2. Use the option --no-follow-parent (and look at the section Handling of SVN branches for more explanation). In this case you can track multiple branches/tags but the history of a new tag/branch will not be connected to its ancestor.


      3. In some situations git svn tries to reread the history from r0 up to HEAD. It does so with 100 revisions per chunk which can be very slow for large/old repos. In this case you can try to speed things up using the option --log-window-size=3000 for git svn fetch (See doc here).






      share|improve this answer

























        0












        0








        0







        If you fetch multiple branches/tags from SVN then, by default, git svn tries to connect these to the last common ancestor. Finding this ancestor can be very expensive -- sometimes git svn will reread the complete history of the repository.



        On the other hand your alias seems to be concerned only about trunk ignoring any tags and branches. Given this situation you have several options with varying consequences:



        1. Setup your git repository for exactly one branch. Do not use the options -s or --stdlayout. Obviously you will only sync a certain part of the SVN repo.


        2. Use the option --no-follow-parent (and look at the section Handling of SVN branches for more explanation). In this case you can track multiple branches/tags but the history of a new tag/branch will not be connected to its ancestor.


        3. In some situations git svn tries to reread the history from r0 up to HEAD. It does so with 100 revisions per chunk which can be very slow for large/old repos. In this case you can try to speed things up using the option --log-window-size=3000 for git svn fetch (See doc here).






        share|improve this answer













        If you fetch multiple branches/tags from SVN then, by default, git svn tries to connect these to the last common ancestor. Finding this ancestor can be very expensive -- sometimes git svn will reread the complete history of the repository.



        On the other hand your alias seems to be concerned only about trunk ignoring any tags and branches. Given this situation you have several options with varying consequences:



        1. Setup your git repository for exactly one branch. Do not use the options -s or --stdlayout. Obviously you will only sync a certain part of the SVN repo.


        2. Use the option --no-follow-parent (and look at the section Handling of SVN branches for more explanation). In this case you can track multiple branches/tags but the history of a new tag/branch will not be connected to its ancestor.


        3. In some situations git svn tries to reread the history from r0 up to HEAD. It does so with 100 revisions per chunk which can be very slow for large/old repos. In this case you can try to speed things up using the option --log-window-size=3000 for git svn fetch (See doc here).







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Dec 30 '18 at 16:26









        A.H.A.H.

        46.5k117198




        46.5k117198





























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53314904%2fwhen-importing-tag-git-downloads-again-full-commit-history%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Use pre created SQLite database for Android project in kotlin

            Darth Vader #20

            Ondo