FFmpeg-Builds/images/base/git-mini-clone.sh

11 lines
235 B
Bash
Raw Normal View History

2020-09-05 20:34:23 +00:00
#!/bin/bash
set -xe
REPO="$1"
REF="$2"
DEST="$3"
git init "$DEST"
git -C "$DEST" remote add origin "$REPO"
git -C "$DEST" fetch --depth=1 origin "$REF"
git -C "$DEST" config advice.detachedHead false
git -C "$DEST" checkout FETCH_HEAD