问答详情
源自:2-4 上传代码至github

上传不了。。


PS C:\Users\msi\Desktop\test-demo> git init

Initialized empty Git repository in C:/Users/msi/Desktop/test-demo/.git/

PS C:\Users\msi\Desktop\test-demo> git add .

PS C:\Users\msi\Desktop\test-demo> git commit -m 第一次上传文件

[master (root-commit) ce589ae] 第一次上传文件

 3 files changed, 24 insertions(+)

 create mode 100644 index.html

 create mode 100644 javascript.js

 create mode 100644 style.css

PS C:\Users\msi\Desktop\test-demo> git remote add origin https://github.com/xietiantian98/test-demo.git

PS C:\Users\msi\Desktop\test-demo> git push -u origin main

error: src refspec main does not match any

error: failed to push some refs to 'https://github.com/xietiantian98/test-demo.git'

PS C:\Users\msi\Desktop\test-demo> git pull --rebase origin master

fatal: unable to access 'https://github.com/xietiantian98/test-demo.git/': Failed to connect to github.com port 443 after 21017 ms: Timed out

PS C:\Users\msi\Desktop\test-demo> git push origin master -f

fatal: unable to access 'https://github.com/xietiantian98/test-demo.git/': OpenSSL SSL_read: Connection was reset, errno 10054

PS C:\Users\msi\Desktop\test-demo> git config --global --unset http.proxy

PS C:\Users\msi\Desktop\test-demo> git config --global --unset https.proxy

PS C:\Users\msi\Desktop\test-demo> git push -u origin main

error: src refspec main does not match any

error: failed to push some refs to 'https://github.com/xietiantian98/test-demo.git'

PS C:\Users\msi\Desktop\test-demo> git push -f origin master


提问者:慕仔8415870 2021-09-24 22:29

个回答

  • weixin_慕后端6376967
    2021-09-29 16:17:03

     PS C:\Users\2230\AppData\Roaming\npm\测试\POS\pos-s> git pull --rebase origin master

    fatal: couldn't find remote ref master

    PS C:\Users\2230\AppData\Roaming\npm\测试\POS\pos-s> git push origin master

    Logon failed, use ctrl+c to cancel basic credential prompt.

    Enumerating objects: 39, done.

    Counting objects: 100% (39/39), done.

    Delta compression using up to 6 threads

    Compressing objects: 100% (33/33), done.

    Writing objects: 100% (39/39), 98.24 KiB | 3.07 MiB/s, done.

    Total 39 (delta 0), reused 0 (delta 0), pack-reused 0

    To https://github.com/sun-cat/sun.git

     * [new branch]      master -> master

    最后成功,用这两行命令