Search code examples
subgit

How to import tags from multiple folders?


I successfully executed subgit import on large old repository. Later i discovered, that there were two directories for tags: default tags and tag.

I tried to edit subgit config file according to advices in Does subgit support multiple 'branches' directories?

Currently i have tags configured the following way:'

tags = tags/*:refs/tags/*
tags = tag/*:refs/tags/tag/*

But now when i try to execute import command again, Subgit does nothing, like everything seems to be already up to date. What i did wrong or i need to run subgit import from scratch?


Solution

  • Indeed, you have to start importing from scratch. You can run

    $ subgit configure --svn-url SVN_URL repo.git
    

    Then edit repo.git/subgit/config to specify

    tags = tags/*:refs/tags/*
    tags = tag/*:refs/tags/tag/*
    

    Then

    $ subgit install repo.git
    

    and finally

    $ subgit uninstall repo.git
    

    to stop continuous synchronization. You can also use "subgit import" command as a shortcut for "subgit install" + "subgit uninstall".

    As a bonus you'll have all SVN revision numbers saved in refs/svn/map reference. To see revision numbers in "git log" output you can setup you Git clients as it is recommended in SubGit book or run the following command on the server:

    $ git update-ref refs/notes/commits refs/svn/map