-
Notifications
You must be signed in to change notification settings - Fork 4
feat(git): add gsync script for syncing and cleaning stale branches #33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Transform gsync from alias to standalone script in bin/ - Auto-detect and pull from remote's default branch - Find local branches with no matching remote branch - Warn about unpushed commits before prompting to delete - Interactive prompts for force-deleting unmerged branches - Auto-detect pnpm projects for build/test commands
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR transforms gsync from a simple git alias into a comprehensive bash script that automates syncing with remotes, detecting and cleaning up stale local branches, and optionally running pnpm project commands. The implementation introduces intelligent branch detection and interactive prompts for safe branch cleanup.
Key Changes:
- Replaces upstream tracking
[gone]detection with direct comparison of local vs remote branches - Adds unpushed commit detection and warnings before deletion prompts
- Implements interactive prompts for force-deleting branches with uncommitted work
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| bin/gsync | Core script implementation with branch detection, cleanup logic, and interactive prompts |
| docs/plans/2025-12-12-gsync-script-design.md | Design documentation reflecting the new implementation approach |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Combine range specification into single quoted string to prevent potential word splitting issues with branch names.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 2 out of 3 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]>
- The git log command shows commits not in default branch, not unpushed commits - A commit can be pushed to remote but still not merged into default branch - Updated comment, variable name, and user-facing message for accuracy
…files into feat/sync-remote-branches
Update