shawn@DESKTOP-74PQKO0:~$ git remote add origin git@github.com:WYYVDCode/Git-work.git
fatal: remote origin already exists.
shawn@DESKTOP-74PQKO0:~$ git push -u origin master
error: src refspec master does not match any.
error: failed to push some refs to 'https://github.com/WYYVDCode/Git-work.git'
shawn@DESKTOP-74PQKO0:~$ git push -f origin master
shawn@DESKTOP-74PQKO0:~$ git remote add origin https://github.com/WYYVDCode/Git-work.git
shawn@DESKTOP-74PQKO0:~$ git pull origin master --allow-unrelated-histories
fatal: unable to access 'https://github.com/WYYVDCode/Git-work.git/': gnutls_handshake() failed: The TLS connection was non-properly terminated.
shawn@DESKTOP-74PQKO0:~$ git branch -M main
shawn@DESKTOP-74PQKO0:~$ git push -u origin main
fatal: unable to access 'https://github.com/WYYVDCode/Git-work.git/': Failed to connect to github.com port 443: Connection refused
看报错的话,我估计是你把origin地址设置成了http协议地址,而不是ssh协议。可以试着用git remote set-url origin修改。
git remote set-url origin
Sign in to make a reply
懒惰的IT
shawn@DESKTOP-74PQKO0:~$ git remote add origin git@github.com:WYYVDCode/Git-work.git
fatal: remote origin already exists.
shawn@DESKTOP-74PQKO0:~$ git push -u origin master
error: src refspec master does not match any.
error: failed to push some refs to 'https://github.com/WYYVDCode/Git-work.git'
shawn@DESKTOP-74PQKO0:~$ git push -f origin master
error: src refspec master does not match any.
error: failed to push some refs to 'https://github.com/WYYVDCode/Git-work.git'
shawn@DESKTOP-74PQKO0:~$ git remote add origin https://github.com/WYYVDCode/Git-work.git
fatal: remote origin already exists.
shawn@DESKTOP-74PQKO0:~$ git pull origin master --allow-unrelated-histories
fatal: unable to access 'https://github.com/WYYVDCode/Git-work.git/': gnutls_handshake() failed: The TLS connection was non-properly terminated.
shawn@DESKTOP-74PQKO0:~$ git branch -M main
shawn@DESKTOP-74PQKO0:~$ git push -u origin main
fatal: unable to access 'https://github.com/WYYVDCode/Git-work.git/': Failed to connect to github.com port 443: Connection refused