MANIFEST=git://github.com/minimal-manifest-twrp/platform_manifest_twrp_omni.git
BRANCH=10.0
TREE_TYPE=omni
TWRP_TREE=https://github.com/Redmi-MT6768/omni_device_xiaomi_merlin
ANDROID_VERSION=10
DEVICE_CODENAME=merlin
DEVICE_PATH=device/xiaomi/merlin
#
#
#
#

mkdir -p /tmp/rec
cd /tmp/rec

# Repo init command, that -device,-mips,-darwin,-notdefault part will save you more time and storage to sync, add more according to your rom and choice.Optimization is welcomed! Let's make it quit, and with depth=1 so that no unnecessary things.
repo init --no-repo-verify --depth=1 -u "$MANIFEST" -b "$BRANCH" -g default,-device,-mips,-darwin,-notdefault
git config --global user.name "Box In A Box"
git config --global user.email "evanferrao@gmail.com"

# Sync source with -q, no need unnecessary messages, you can remove -q if want! try with -j30 first, if fails, it will try again with -j8
repo sync -c --no-clone-bundle --no-tags --optimized-fetch --prune --force-sync -j$(nproc --all) || repo sync -c --no-clone-bundle --no-tags --optimized-fetch --prune --force-sync -j8

pwd
ls

#delete these lines, and replace with your own lines of device sauce
git clone $TWRP_TREE $DEVICE_PATH
cd /tmp/rec
