Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
git-subtree support shell.
repo=<subtree-repo path>
remote=<subtree-repo remote name>
branch=<subtree branch>
path=<local subtree path>
if [ $# -eq 0 ]; then
echo "this is git-subtree-suppot tool.\noptions:\n init\n pull\n push"
exit 1
if [ $1 = init ]; then
git remote add ${remote} ${repo}
git fetch ${remote}
git subtree add --prefix=${path} ${remote} ${branch}
elif [ $1 = pull ] ; then
git subtree pull --prefix=${path} ${remote} ${branch}
elif [ $1 = push ] ; then
git subtree push --prefix=${path} ${remote} ${branch}
echo "$1 option not found"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment