Created
July 20, 2016 10:00
-
-
Save adejones/6caf60966c4340cf2fecdfb48ffa8af3 to your computer and use it in GitHub Desktop.
This file contains 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
# cd to the full repo directory | |
cd path/to/full_repo | |
# export tracked files in sub directory by creating a filemap | |
export SUBDIR=name_of_subdir | |
hg locate -I "$SUBDIR" | awk '{print "include \"" $1 "\"";}' > ../filemap.txt | |
echo "rename \"$SUBDIR\" ." >> ../filemap.txt | |
# create new repo using filemap | |
hg convert --filemap ../filemap.txt . ../new_repo_name | |
# cd to new repo and update to latest head revision, the update is required if you want to see your files | |
cd ../new_repo_name | |
hg update |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment