Created
December 22, 2019 15:45
-
-
Save sohmc/cf39c48856e474694e919ab69ce98623 to your computer and use it in GitHub Desktop.
Convert hg repositories to git.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| if [[ -z $REPO ]]; then | |
| read -p "Please provide the hg clone URL: " REPO | |
| fi | |
| echo "Cloning repository ${REPO}..." | |
| hg clone ${REPO} ./gitify | |
| cd ./gitify | |
| echo "Creating Bookmarks" | |
| hg bookmark -r default master | |
| echo "Changing default path to github" | |
| sed -ri 's/ssh:\/\/[email protected]\/(.*)/git+ssh:\/\/[email protected]\/\1.git/' . hg/hgrc | |
| echo "Pushing to github..." | |
| hg push | |
| echo "Removing directory..." | |
| cd .. | |
| rm -rf ./gitify |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
REQUIRES
hg git mercurialplugin