GitHub added a feature about a month ago to resolve merge conflicts on the web interface, however it only works for "simple" merge conflicts:
No conflicts
Simple conflicts
Complex conflicts
In the blog post that introduced the new feature, GitHub mentions competing line changes, which can range from fairly simple to quite complex.
What qualifies as a conflict too complex to resolve in the web editor?
Often, merge conflicts happen when people make different changes to the same line of the same file, or when one person edits a file and another person deletes the same file. You must resolve all merge conflicts before you can merge a pull request on GitHub.
So, now that you know what is a merge conflict and when does it occur, let’s see how to fix it! Follow these steps to resolve merge conflicts in Git pull requests: We will make sure that code on both the branches is updated with the remote. If not, first take pull of both the branches or push your local changes if any.
However, merge requests that have a conflict are a little bit more hard to handle. Here’s how I get this done. In this example, let’s work with 2 branches:
If prompted, review the branch that you are committing to. If the head branch is the default branch of the repository, you can choose either to update this branch with the changes you made to resolve the conflict, or to create a new branch and use this as the head branch of the pull request.
feature-1 (the branch issuing pull request) Step 1: Verify your local repo To start off, ensure that you have the latest files for the prodbranch. git checkout prod git pull origin prod This will ensure that the files on local repository are in-sync with your remote git repo (Github/Bitbucket, etc). Step 2: Switch to branch
This seems to happen if any files were renamed, I had a pull request that included renamed files showing the same message and as soon as I named the files back and committed that the "Resolve conflicts" became available again
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With