DEV Community

Discussion on: Let My People Go: the Hg to Git evacuation process.

Collapse
 
zer0pants profile image
Mike Roberts

I read your post earlier today and it was great.

Just posted this really basic method for converting your repos from hg to git which might be sufficient for some: dev.to/zer0pants/hg-to-git-with-no...

Additional tips:

Resolving issues with Authors:

Reference: git-scm.com/book/en/v2/Git-and-Oth...
Reference: Atlassian - probably the best guide I've seen

hg log | grep user: | sort | uniq | sed 's/user: *//' > ../authors.txt

# Edit this file as described in the reference above.
# When running the import command don't forget the -A flag and to reference this file

Resolving issues with branch names

Unnamed heads - reference

  • Basically checkout the revision. Branch off. Make a commit to persist the branch

Cannot lock ref - reference

  • Basically same method as authors but now for branches.
  • Map the problem branch to something not problematic
  • In the below example the branch release is an issue
hg log | grep branch: | sort | uniq | sed 's/branch: *//' > ../branches.txt

# branches.txt (before)
release  
release/123
release/456

# branches.txt (after)

"release"="release-branch"

Hope it helps someone out there!
Mike