if conflict with main, checkout main then pull origin main. checkout branch. merge main, fix conflict. add and commit. push again.
Commands that are useful.
git remote add upstream [URL of upstream]
git fetch upstream
git checkout main
git merge upstream/main -- resolve conflicts
git add / commit
git push
git checkout branch
git merge main
git resolve
git add / commit
git push