If the GitHub repo has seen new commits pushed to it, while you were working locally, I would advise using: git pull --rebase. git push. The full syntax is: git pull --rebase origin main. git push origin main. With Git 2.6+ (Sept. 2015), after having done (once) git config --global pull.rebase true. More @Wikipedia
Hover over any link to get a description of the article. Please note that search keywords are sometimes hidden within the full article and don't appear in the description or title.