init: init commit
All checks were successful
Build and Deploy Quartz / build-and-deploy (push) Has been skipped

This commit is contained in:
2026-01-01 14:16:34 +08:00
commit 4a5acab07d
216 changed files with 40383 additions and 0 deletions

View File

@@ -0,0 +1,47 @@
import { execSync } from "child_process"
function run(cmd) {
try {
console.log(`> ${cmd}`)
execSync(cmd, { stdio: "inherit" })
} catch (e) {
console.error(`Error running: ${cmd}`)
process.exit(1)
}
}
function main() {
// Step 1: Create orphan branch
run("git checkout --orphan temp-branch")
// Step 2: Add all files
run("git add .")
// Step 3: Commit
run('git commit -m "init: init commit"')
// Step 4: Rename current main to old
run("git branch -m main old")
// Step 5: Rename temp-branch to main
run("git branch -m temp-branch main")
// Step 6: Checkout main
run("git checkout main")
// Step 7: Set upstream for main branch to origin/main
run("git branch --set-upstream-to=origin/main main")
// Step 8: Set upstream for old branch to origin/old if it exists locally
try {
run("git show-ref --verify --quiet refs/heads/old")
run("git branch --set-upstream-to=origin/old old")
console.log("Upstream for 'old' branch set to origin/old.")
} catch (e) {
console.log("Local 'old' branch does not exist, skipping upstream setup.")
}
console.log("Git history cleared and remote branches updated.")
}
main()