Split directories in git to new repository -
i dont know if approach correct result want. me figure out?
i have repository abbr repo 3 solutions split up.
before:
root |_project1 |_project2 |_project3
after:
root |_project1
etc etc.
my approach:
git clone <url-to-old-repo> <new-repo-folder> cd <new-repo-folder> git checkout <branch> git remote rm origin git filter-branch \ --prune-empty \ --index-filter ' git rm --cached -qr --ignore-unmatch -- . && git reset -q $git_commit -- \ <project-folder> ' \ -- \ --all git remote add origin <url-to-new-repo> git push -u origin <branch>
after these commands, end new repo folder want , history preserved. , done 3 projects. remaining repo contains project unused in future, maybe kept backup.
Comments
Post a Comment