-
Notifications
You must be signed in to change notification settings - Fork 0
Add .gitattributes merge strategy for custom workflow files #51
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
base: my-build
Are you sure you want to change the base?
Conversation
…strategy Co-authored-by: ignotus666 <[email protected]>
Co-authored-by: ignotus666 <[email protected]>
…cumentation Co-authored-by: ignotus666 <[email protected]>
|
@copilot I'd even prefer if you could just tell me what to choose between "Accept current change | Accept incoming change | Accept both changes" in order to manually resolve the conflicts and preserve my original file |
…Change" Co-authored-by: ignotus666 <[email protected]>
Choose "Accept Current Change" (or "Keep Ours" in some Git tools). This keeps your my-build version and discards the incoming changes from master. Updated in commit dae352a. |
|
@copilot When I click on "Accept Current Change" it says it'll commit changes to master - that's not what I want |
Co-authored-by: ignotus666 <[email protected]>
That's actually correct! When you're on Make sure you're ON the my-build branch first: git checkout my-build
git merge masterThen "Accept Current Change" keeps your my-build version, and the merge commits to my-build. This is what you want. Clarified in commit 9d36d61. |
|
@copilot I'm doing this on the github website, after clicking on "resolve conflicts" in the PR - so I'm not "on" any branch |
Co-authored-by: ignotus666 <[email protected]>
Got it! On GitHub's web interface:
Your custom autobuild.yml will be preserved. Updated in commit 25fba80. |
|
@copilot Even if I do that it still wants to commit the changes to master. i think here's the clue: Resolving conflicts between master and my-build and committing changes -> master |
Co-authored-by: ignotus666 <[email protected]>
That's the issue! The PR is targeting Change the PR base branch:
After that, resolve conflicts and merge - it will commit to Updated in commit 1822e55.
My mistake - if the PR is already master → my-build, then it's correct. When you resolve conflicts and commit, it will commit to your Updated instructions in commit 6ac5682 - just keep your custom content when resolving conflicts. |
…merges Co-authored-by: ignotus666 <[email protected]>
Short description of changes
Adds
.gitattributeswithmerge=oursstrategy to preserve customizedautobuild.ymlwhen merging from master into custom branches. Includes comprehensive documentation (MERGE_SOLUTION.md) with manual conflict resolution instructions for GitHub web interface and command line.CHANGELOG: SKIP
Context: Fixes an issue?
Prevents merge conflicts on
.github/workflows/autobuild.ymlfor users maintaining custom build branches with modified workflow configurations when merging updates from master.Does this change need documentation? What needs to be documented and how?
No website documentation needed.
MERGE_SOLUTION.mdprovides complete instructions for:.gitattributesand git config for future mergesStatus of this Pull Request
Working implementation for personal branch maintenance.
What is missing until this pull request can be merged?
Nothing. Ready to merge.
Implementation
The
.gitattributesfile marksautobuild.ymlwithmerge=ours, which requires local git config:git config --local merge.ours.driver "true"Once both are in place, merges from master automatically preserve the custom branch's workflow version without conflicts.
Manual Conflict Resolution on GitHub Web Interface
When merging a PR from master to my-build on GitHub:
autobuild.ymlcontent (between<<<<<<< my-buildand=======)<<<<<<<,=======,>>>>>>>) and the incoming content from masterResult: Your custom autobuild.yml is preserved in my-build. The merge commit is created on the my-build branch (the target branch).
Manual Conflict Resolution via Command Line
git checkout my-buildgit merge masterResult: Your custom
autobuild.ymlis preserved in your custom branch.Checklist
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.