How to handle conflicts in github

This happens a lot. I will try to write out scenarios I’ve dealt with..

Here are ways to deal with conflicts

Decide to delete the file of conflict from Main branch and replace it with the one on Dev branch

git doesn’t know if you meant to delete it. so we need to let main know we want to keep the file.

# from your main branch
git checkout dev -- file.txt
git commit -m 'resolved the conflict by keeping file.txt'

Decide to get rid of the file altogether

Let git know you want to remove it

git rm text.txt