~miconoco/woo

woo/bin/clone -rwxr-xr-x 551 bytes
0b1818b1Christoph Polcin build 3 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/sh
# clone [GIT-FETCH-ARGS]...
#   Clones the repo to the tracked state.

set -e

[ -e ".git" ] && exit 1

git init .

if [ -n "${MURL:-}" ]
then
    git remote add origin "${MURL}"

    if [ -n "${MNREF}" ]
    then
        git fetch "$@" origin -- "${MNREF}"
        git checkout -b "${MNREF}" -t "${MUPS:-origin/${MNREF}}"
    else
        git remote update
    fi

    if [ -n "${MREF}" ]
    then
        git reset --keep "${MREF}"
    fi
    git submodule update --init --recursive --force
fi

git status --short --branch --ahead-behind