Merge conflicts when keeping a branch up to date with main
See original GitHub issueSubject of the issue
When creating a PR off of main to be merged into a production branch we get a ton of merge conflicts. Ideally this would not be the case but I’m not sure what we’re doing wrong or if there is even a way to avoid this. Not sure this is a bug with this action or just something we’ll have to deal with every-time we want to merge our main branch into production. Thanks for the help!
Steps to reproduce
Our github action code:
productionPromotion:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: production
- name: Reset promotion branch
run: |
git fetch origin main:main
git reset --hard main
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
branch: production-promotion
If this issue is describing a possible bug please provide (or link to) your GitHub Actions workflow.
Issue Analytics
- State:
- Created a year ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
How can I keep my branch up to date with master with git?
git checkout <my branch>. to switch the working tree to your branch; then: git merge master. to merge all the changes in master...
Read more >Git merge vs rebase to keep feature branch up to date
Today we are going to look at how Git merge and rebase commands behave while trying to keep feature branch up to date....
Read more >Keeping a feature branch up-to-date with master— rebase vs ...
Merge creates a new commit containing all the differences that got introduced in master since you branched (or since you last merged) that...
Read more >How to keep your feature branch up to date. - TecAdmin
Checkout the master branch and switch to it · Update master branch with latest code · Change back to your feature (original) branch...
Read more >How to Resolve Merge Conflicts in Git – A Practical Guide with ...
Always pull from remote/other related branches before you start any new logical work on your code. It will keep your branch up-to-date as...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks for the response! Ended up having to modify the reset promotion branch step a bit to but this works great now:
Yes, it does, but I’m not sure why you need the same branch twice if they won’t differ in anything. You could use master as your production branch for this matter. IDK, you sure have your reasons.