Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Create a Roots.io project working with Git Subtrees, Trellis, Bedrock, Sage
#change de URL of the repo
repo=<repo_url.git>
tools=(trellis bedrock sage) #tool from roots.io
subtrees=(trellis site site/web/app/themes/sage) #folder structure for the tools
#init repo
git init
git remote add origin ${repo}
touch .gitignore
git add .
git commit -m "initial commit"
#create the project
count=0
for tool in ${tools[@]}; do
git remote add ${tool} https://github.com/roots/${tool}.git
git fetch ${tool}
git checkout -b ${tool} ${tool}/master
git checkout master
git read-tree --prefix=${subtrees[$count]}/ -u ${tool}/master
git commit -m "add ${tool} subtree"
git push origin master
count=$(( $count + 1 ))
done
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.