Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Rename Package and Keep History
git filter-branch -f --prune-empty --tree-filter '
find . \
-name .git -prune -o \
-exec sh -c "file {} | grep -q text" \; \
-exec sed -i "" \
-e "s/X/Y/g" \
-e "s/com.x.y/com.github.makiftutuncu.trump/g" \
-e "s/x/y/g" \
{} \; \
&& mkdir -p src/main/scala/com/github/makiftutuncu/trump && mkdir -p src/test/scala/com/github/makiftutuncu/trump && tree src && mv src/main/scala/com/x/y/* src/main/scala/com/github/makiftutuncu/trump && mv src/test/scala/com/x/y/* src/test/scala/com/github/makiftutuncu/trump && tree src
'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment