I am not able to push a local repository to a GitHub repo, both created at the same time.
The steps I took:
- In Visual Studio Code (VS Code) I select
Open Folder
to add the project folder. - I click on the
Source Control
pane and thenInitialise Repository
. - I
Stage
andCommit
the files using the VS Code GUI. - On GitHub online I create a
New repository
, naming it and not adding any other files (e.g..gitignore
). - I copy from the GitHub instructions that appear and run the command in the VS Code terminal (git bash):
git remote add origin https://github.com/username/reponame.git
- I then try to
Publish Branch
via VS Code GUI, or run the code in the VS Code terminal from GitHub:git push -u origin main
, BUT both fail and produce the error that follows:
# GIT ERROR
> git push origin main
error: RPC failed; curl 92 HTTP/2 stream 0 was not closed cleanly: CANCEL (err 8)
send-pack: unexpected disconnect while reading sideband packet
fatal: the remote end hung up unexpectedly
Everything up-to-date
# TERMINAL OUTPUT
$ git push -u origin main
Enumerating objects: 45, done.
Counting objects: 100% (45/45), done.
Delta compression using up to 8 threads
Compressing objects: 100% (44/44), 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% (45/45), 151.59 MiB | 10.27 MiB/s, done.
Total 45 (delta 5), reused 0 (delta 0), pack-reused 0
fatal: the remote end hung up unexpectedly
Everything up-to-date
I've deleted the local .git
folder and the GitHub repo and tried multiple times, but can't get it to work.
I appreciate any help.