Not able to migrate source code with subgit

1k Views Asked by At

I am trying to migrate source code with subgit, it says import sucess but, when I open directory, I see only git and subgit folders with some meta data and history files, but no actual source code, my branches directory is also empty.

Peg location detected: r526 nmpc_framework/trunk Fetching SVN history... Done. Growing trees... Done. Project origin detected: r390 nmpc_framework/trunk Building branches layouts... Done. Combing beards... Done. Generating SVN to Git mapping... Done.

CONFIGURATION SUCCESSFUL

To complete SubGit installation do the following:

1) Adjust Subversion to Git branches mapping if necessary: C:\Sources\Git\TestMigrationNMPC\subgit\config 2) Define at least one Subversion credentials in default SubGit passwd file at: C:\Sources\Git\TestMigrationNMPC\subgit\passwd OR configure SSH or SSL credentials in the [auth] section of: C:\Sources\Git\TestMigrationNMPC\subgit\config 3) Optionally, add custom authors mapping to the authors.txt file(s) at: C:\Sources\Git\TestMigrationNMPC\subgit\authors.txt 4) Run SubGit 'install' command: subgit install "C:\Sources\Git\TestMigrationNMPC"

C:\Users\h175494\Downloads\subgit-3.2.7\subgit-3.2.7\bin>subgit import "C:\Sourc es\Git\TestMigrationNMPC" SubGit version 3.2.7 ('Bobique') build #3729

Translating Subversion revisions to Git commits...

Subversion revisions translated: 526.
Total time: 108 seconds.

IMPORT SUCCESSFUL

Here are the commands I am executing -

subgit configure http://address.global.ds.mycompany.com/svn/onramp/nmpc_framework C:/Sources/Git/TestMigrationNMPC

subgit import "C:\Sources\Git\TestMigrationNMPC"

Screenshot of directory structure created

What wrong I am doing here?

2

There are 2 best solutions below

0
On

I'm glad OP found an answer, as it was also not obvious to me at first why there was no source code in the repository. As they said, subgit's import feature creates a bare repository (i.e. one that is only ever used as a remote to a "checked out" repo).

That said, this "fix" is probably more appropriate for most users (including myself) than the OP's answer:

git clone pathToBareRepo pathToDesiredRepo

*Note: pathToBareRepo looks a lot like the .git folder of most repos, so it has a branches, db, hooks, subgit, etc.

Doing it this way sets up a proper clone with the bare repo as a remote. It also checks out the default branch (usually master).

0
On

Ok, I found a fix after a day of search. This creates a bare repository. Needs to be converted to normal one. Follow below steps -

To convert a --bare repository to a non-bare:

  1. Make a .git folder in the top-level of your repository.
  2. Move the repository management things (HEAD branches config description hooks info objects refs etc.) into the .git you just created.
  3. Run git config --local --bool core.bare false to convert the local git-repository to non-bare.
  4. (via comment by Tamás Pap) After step #3 you will see that you are on branch master (or whichever your main branch is) and all your files are deleted and the deletion is staged. That's normal. Just manually checkout master, or do a git reset --hard, and you are done.