publish-site: push HEAD:site from a throwaway orphan
The local branch survived the worktree and collided on the second run. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -9,13 +9,13 @@ WORK=$(mktemp -d)
|
||||
trap 'rm -rf "$WORK"' EXIT
|
||||
git worktree add -q --detach "$WORK"
|
||||
cd "$WORK"
|
||||
git checkout -q --orphan site
|
||||
git checkout -q --orphan publish-tmp
|
||||
git rm -rq --cached . 2>/dev/null || true
|
||||
find . -mindepth 1 -maxdepth 1 ! -name .git -exec rm -rf {} +
|
||||
mkdir dist && cp -R "$OLDPWD/dist/." dist/
|
||||
git add -A
|
||||
git commit -q -m "site: built from $SHA"
|
||||
git push -qf origin site
|
||||
git push -qf origin HEAD:site
|
||||
cd "$OLDPWD"
|
||||
git worktree remove --force "$WORK"
|
||||
echo "published site branch from $SHA"
|
||||
|
||||
Reference in New Issue
Block a user