Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Create a project working with Git Subtrees, Trellis, Bedrock, Sage
#change de URL of the repo
tools=(trellis bedrock sage) #tool from
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
for tool in ${tools[@]}; do
git remote add ${tool}${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 ))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment