0

I have converted a mercurial repo to a git repo by using hg-git (like this : How to convert mercurial repository to git repository without losing branches?).

Now I have both .git and .hg folders now but I should not need to .hg folder. But if I delete this folder, I cant open my project folder with SourceTree.

The .hg folder has bookmark,git-mapfile,hgrc, branch etc files and store folder. I guess I don't need these files. What should I do ?

StayOnTarget
  • 11,743
  • 10
  • 52
  • 81
eagle
  • 451
  • 1
  • 7
  • 27
  • 1
    Git does not need `.hg` folder for anything, so you can delete it. What error does sourcetree show after deleting it? – 1615903 May 15 '19 at 08:41
  • 'this is not valid working copt path'. I cant open. – eagle May 15 '19 at 09:41
  • 1
    It sounds like SourceTree is trying to open it as an HG repo. If you git clone it to a new folder, and open from there does that work? – StayOnTarget May 15 '19 at 10:47
  • What specific errors do you get in SourceTree? Can you use the git command line program normally or does it error out too? Have you done anything in SourceTree to tell it that the converted repo is now git instead of hg? – StayOnTarget May 16 '19 at 11:54

1 Answers1

0

If you think you've got it to a state where the git equivalent repository is correct, then I would do the following:

  • git clone the converted repo to a new repo (i.e. in a new directory on the same PC)

  • Remove the original from SourceTree or whatever GUI front end you are using

  • Open the new repo from the GUI. Try some stuff out, build confidence that it works.

  • If the prior step is OK, remove (or archive) the original

If the problem is really that the GUI is confused about the state of the converted repo, this may help clear it up and also verify that your conversion worked as intended.

Note - I'm not really a git nor SourceTree person so I've deliberately left the above steps somewhat descriptive rather than prescriptive.

StayOnTarget
  • 11,743
  • 10
  • 52
  • 81