Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions scripts/update_from_template.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
#! /bin/bash
set -eo pipefail

git config --global pull.rebase false
git remote add template https://github.com/blooop/python_template.git
TEMPLATE_URL="${TEMPLATE_URL:-https://github.com/blooop/python_template.git}"
BRANCH="${BRANCH:-feature/update_from_template}"

git config pull.rebase false
git remote remove template 2>/dev/null || true
git remote add template "$TEMPLATE_URL"
git fetch --all
git checkout main && git pull origin main
git checkout -B feature/update_from_template; git pull
git checkout -B "$BRANCH"
git merge template/main --allow-unrelated-histories -m 'feat: pull changes from remote template'
git checkout --ours pixi.lock
git checkout --ours pixi.lock 2>/dev/null || true

# regenerate lockfile to match merged pyproject.toml
pixi update
git add pixi.lock
git diff --cached --quiet || git commit -m 'chore: update pixi.lock after template merge'

git remote remove template
git push --set-upstream origin feature/update_from_template
git push --set-upstream origin "$BRANCH"
git checkout main
Loading