git push is successful and able to see compare and pull in git hub but not able to accept it or merge it

Viewed 107

git hub commands enter image description here

git push is successful and able to see compare and pull in git hub but not able to accept it or merge it could someone help me with this

1 Answers

Note: the new GitHub repositories are created with the default branch named main, not master.

By pushing your local master, you are pushing an unrelated history (no common ancestor commit), which means there can be no comparison between two different branches based on two entirely different histories (pbchandra/test commits main vs. pbchandra/test commits master).

So it is best to change your local repository default branch to main:

cd /path/to/local/repo
git branch -m master main
git fetch
git rebase origin/main
git push --force -u origin main
Related