Skip to content

Fix deploy targets failing when run from a non-target branch#34

Merged
sebastientaggart merged 2 commits intodevfrom
feature/fix-deploy-branch-checkout
Mar 26, 2026
Merged

Fix deploy targets failing when run from a non-target branch#34
sebastientaggart merged 2 commits intodevfrom
feature/fix-deploy-branch-checkout

Conversation

@sebastientaggart
Copy link
Copy Markdown
Contributor

Add git checkout to deploy-preview and deploy-prod so they switch to the target branch before pulling and pushing. Previously, running these targets from a different branch caused git pull --rebase to rebase the current branch instead of updating the target, leaving the local target ref stale and the push failing with a non-fast-forward error.

Issue #33

sebastientaggart and others added 2 commits March 26, 2026 12:00
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@sebastientaggart
Copy link
Copy Markdown
Contributor Author

Review Summary

Verdict: APPROVE

Findings

  • [NOTE] After deploy-preview or deploy-prod completes, the user is left on the target branch (dev or main) rather than the branch they started on. This is a behavioral side-effect of the fix. Consider whether returning to the original branch (e.g., saving it with git rev-parse --abbrev-ref HEAD beforehand and checking it out in a final step) would be worthwhile. Not blocking since deploy targets are typically run intentionally and the user can switch back manually.

No critical or security issues found. The fix correctly addresses the non-fast-forward failure described in #33 by ensuring the working tree is on the target branch before pulling and pushing.

@sebastientaggart sebastientaggart merged commit 2eb222a into dev Mar 26, 2026
2 checks passed
@sebastientaggart sebastientaggart mentioned this pull request Mar 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant