-
Notifications
You must be signed in to change notification settings - Fork 36
Change update command to override local changes by default #4233
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
- Added --merge flag to preserve local changes via 3-way merge - Default behavior now overrides local changes with upstream content - Updated help text to explain new default behavior - Added tests for both override and merge modes - All existing tests pass Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
- All unit tests passing - Code formatted with make fmt - Code linted with make lint - Build successful - Help text verified and working correctly Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
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 changes the default behavior of the update command from performing 3-way merges (which could lead to merge conflicts) to simply overriding local changes with the latest upstream version. Users who want the previous merge behavior can now opt-in using the --merge flag.
Key Changes:
- Added
--mergeflag to enable 3-way merge behavior (previous default) - Modified update logic to branch between override mode (new default) and merge mode
- Updated help text and examples to document the new behavior
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
pkg/cli/update_command.go |
Added --merge flag, updated help text, refactored updateWorkflow() to branch between override and merge modes, threading the merge parameter through all update functions |
pkg/cli/update_command_test.go |
Added two new test functions for override and merge modes (though tests lack meaningful assertions) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Update documentation to reflect recent changes to the 'gh aw update' command: - Default behavior now replaces local file with upstream version (no conflicts) - New --merge flag enables 3-way merge to preserve local changes - Added git fallback support for public repositories without authentication - Clarified update modes with table showing default vs merge behavior - Added authentication section explaining git fallback functionality Changes documented from: - PR #4233: Changed update command to override local changes by default - PR #4238: Added git fallback when GitHub API authentication fails 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
The
updatecommand previously performed 3-way merges by default, which could produce unpredictable merge conflicts. This changes the default behavior to override local changes, with merge available via--mergeflag.Changes
--mergeflag to opt into 3-way merge behavior (previous default)updateWorkflowto branch on merge mode:Behavior
gh aw updategh aw update --mergeMigration
Users wanting the previous behavior: add
--mergeto update commands.Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.