So I have a git repo with the following structure:
cartridges
mainapp
helpers
utils
I want to essentially move everything within cartridges up one level and remove cartridges. So all the folders inside the cartridges folder are at the root level themselves. But I want to preserve the last commit on every file so I can glance at github and see what was last touched 3 years ago etc.
mainapp
helpers
utils
I found this answer: Moving a git repository up one hierarchy level
But I'm not sure how to adapt that for my case.
time git filter-branch --index-filter 'git ls-files -s |
sed "s-\t\"*-&webroot/-" |
GIT_INDEX_FILE=$GIT_INDEX_FILE.new git update-index --index-info &&
mv $GIT_INDEX_FILE.new $GIT_INDEX_FILE' --tag-name-filter cat -- --all