Skip to content

Instantly share code, notes, and snippets.

@teknoraver
Created August 21, 2015 10:11
Show Gist options
  • Save teknoraver/547e3774f271cffd179f to your computer and use it in GitHub Desktop.
Save teknoraver/547e3774f271cffd179f to your computer and use it in GitHub Desktop.
#!/bin/sh
[ -d "$1/.git" ] || exec echo "$1 is not a git repository"
cp -r $1/.git .
git checkout AndroidManifest.xml && git mv -f AndroidManifest.xml app/src/main/
git checkout res && {
rm -rf app/src/main/res/
git mv res app/src/main/
}
git checkout src && {
rm -rf app/src/main/java/
git mv -f src/* app/src/main/java/
}
git checkout assets && git mv assets/ app/src/main/
rm gradlew.bat
git status -s |awk '/^ D/{print$2}' |xargs git rm
sed -i 's|<mapping directory="" vcs="" />|<mapping directory="$PROJECT_DIR$" vcs="Git" />|' .idea/vcs.xml
echo -e "now:\n\tgit add --all\n\tgit commit -am'switch to android studio'"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment