Add a new remote called plugin
pointing to the plugin's repository:
git remote add plugin https://path.to/remotes/plugin.git
Then Create a subtree specifying the new folder prefix plugins/demo
. plugin
is the remote name, and master
refers to the master branch on the subtree's repository:
git subtree add --prefix=plugins/demo plugin master
Pull normal commits made in plugin:
git subtree pull --prefix=plugins/demo plugin master
Specify commits made in superproject to be backported:
git commit -am "new changes to be backported"
Checkout new branch for merging, set to track subtree repository:
git checkout -b backport plugin/master
Cherry-pick backports:
git cherry-pick -x --strategy=subtree master
Push changes back to plugin source:
git push plugin backport:master