Last active
March 1, 2018 09:58
-
-
Save javierexposito/51c85f8ac810404ac1a4d67af55b1b30 to your computer and use it in GitHub Desktop.
Move files into a new directory preserving history
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
-- create a new empy repo, add the origin of the repo we want to move files, create new branch and fetch | |
mkdir new-repo | |
cd new-repo | |
git init | |
git remote add origin git@github.com:javierexposito/origin-repo.git | |
git commit --allow-empty "Initial commit" | |
git checkout moving-files | |
git fetch origin | |
git subtree add --prefix=new-folder f54a8b6d7 (last commit from repo) | |
git push origin | |
hub pull-request |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment