summaryrefslogtreecommitdiff
path: root/deps/acore/bash-lib/src/git-utils/subtree.sh
blob: 1b32c97286f872822ec423af1ca99474f398b3b1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
function subtreeFlow {
    local name=$1
    local path=$2
    local repo=$3
    local branch=$4
    local prefix="$path/$name"

    echo "> Adding subtree if not exists"
    git subtree add   --prefix "$prefix" "$repo" "$branch"
    echo "> Pulling latest changes from remote subtree"
    git subtree pull  --prefix "$prefix" "$repo" "$branch"
}