studiotest / tools /git_init.sh
gulle1155's picture
restore device config, attn impl, tied-weights shim, mamba build script
9227766
Raw History Blame Contribute Delete
526 Bytes
#!/usr/bin/env bash
# Recreate the repo after a Space rebuild wipes /app/.git.
# Needs a WRITE token in $GIT_TOKEN — the auto HF_TOKEN is read-only.
set -euo pipefail
cd "${1:-/app}"
git init -b main
git config user.email "gulle1155@users.noreply.huggingface.co"
git config user.name "gulle1155"
git remote add origin "https://gulle1155:${GIT_TOKEN}@huggingface.co/spaces/gulle1155/studio"
git fetch origin main
git reset --soft FETCH_HEAD
git add -A
echo "--- staged (read this before committing) ---"
git status --short