
___x_cmd_gitb_sync()(
    local target="${1:?Provide repo}"; shift
    local p="${target##*/}"
    p="${p%.git}"
    command git clone --bare "$target" "$p"
    ___x_cmd_inner_cd "$p"

    if x git all push "$@"; then
        ___x_cmd_inner_cd ..
        x rmrf "$p"
    else
        gitb:error "Fail to push. Preserve the gitdir."
    fi
)
