'Failed to publish branch to remote Github repository

I am using Github desktop as an interface and I am trying to push an initialized repository onto GitHub. I actually created the repo on GitHub and cloned it into my local machine and thus is where i made changes.

however even after my changes; I cannot push the changes I have committed towards the remote GitHub repo.

Error message displayed by Github desktop

I have tried using the command git push -u origin main to push changes through the terminal and it still gives me an error displayed below.

Enumerating objects: 885, done.
Counting objects: 100% (885/885), done.
Delta compression using up to 8 threads
Compressing objects: 100% (844/844), done.
error: RPC failed; curl 92 HTTP/2 stream 0 was not closed cleanly: CANCEL (err 8)
send-pack: unexpected disconnect while reading sideband packet
Writing objects: 100% (885/885), 151.08 MiB | 5.03 MiB/s, done.
Total 885 (delta 168), reused 0 (delta 0), pack-reused 0
fatal: the remote end hung up unexpectedly
Everything up-to-date

I need help to see what I am missing; pointers are welcome.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source