Created
February 10, 2018 16:20
-
-
Save larsxschneider/53db48ee83193f19428d70474f429c2d to your computer and use it in GitHub Desktop.
Move all files and directories in a Git repo one level down
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
# Move all files and directories in a Git repo one level down into the "Core" directory | |
git filter-branch --index-filter 'git read-tree --prefix="Core/" $GIT_COMMIT && git ls-files | sed "s/\/.*//" | sort | uniq | grep -v "^Core" | xargs -L1 git rm -r --cached > /dev/null' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment