path=roles/
target=openvpn
reponame=ansible-role-${target}
fullpath=${path}${target}
git subtree split --prefix=$fullpath --branch=${target}-only
git rm -rf $fullpath
mkdir $fullpath
pushd $fullpath
hub create gitinsky/$reponame
git init
git remote add origin https://github.com/gitinsky/${reponame}.git
depth=$(dirs| while read dir1 dir2; do printf "$dir1\n$dir2\n"|tr '/' '\n'; done | sort| uniq -u| { while read p; do printf '../'; done; printf '\n'; } |tee /dev/stderr)
git pull $depth ${target}-only
git push origin -u master
popd
git submodule add https://github.com/gitinsky/${reponame}.git $fullpath
Created
June 25, 2015 13:58
-
-
Save hryamzik/d3b20b71faf2d9a65780 to your computer and use it in GitHub Desktop.
role to submodule
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment