How to "Resolve conflicts" on GitHub pull requests (Solved)

So, I have a repo on GitHub and there is an open pull request. The problem is that I have made commits since the contributor made the pull request. And now the files are conflicting

How do you resolve the conflict? GitHub doesn't explain that at all, not even what these are: "====", ">>>>", "<<<<" (made them shorter)

Did you find this post useful? Show some love!
DISCUSSION (3)

Maybe you need to use rebase to get the commits with previous changes(pull requests) from your repo on github, but maybe this isn't the problem.

If you have conflicts you need to resolve them manually or say to git that resolves throught a merge strategy.

If you trust your changes and you want to set all of them in the repo(positioned in your repo/branch):

git merge -X ours otherbranch

If you dont trust your changes and you want to avoid all of them in the repo(positioned in your repo/branch):

git merge -X theirs otherbranch

But if you want to do this manually, git mergetool can be helpful

<<<<<< and ====== represent divisions between the existing code and the incoming code.

This is git saying "I can't do this automatically, please help.

One block represents the old code, one the new. You should delete one of the chunks from the code, leaving the other and maybe modifying it, and also delete those divider strings.

I use GitKraken which is hooked up to git, and the gui makes it easy to handle merge conflicts. you pull in other peoples changes, and if there's a conflicts, it will tell you and you can pick and choose what you want to resolve the merge conflict. I actually don't know anyone who resolves conflicts without some kind of gui.

the symbols "====", ">>>>", "<<<<" tell you where the head and the conflict is.

I did find this on google, though
rollout.io/blog/resolve-github-mer...

Classic DEV Post from Apr 25

What's your tech stack?

Photo courtesy of Flickr user kreturn I came across this post from @ben today...

READ POST
Follow @nickytonline to see more of their posts in your feed.
TheRedSpy15
On a mission to build simple versions, of complex things, and complex versions, of simple things

Still don't have a dev.to account? You're welcome to lurk, but it's better to be part of the community.

Sign up now ❀️