1. 打开git-cmd

  2. 关闭证书校验:git config --system http.sslverify false

  3. git clone + 仓库url

  4. cd 到仓库目录下,如BattleCity

  5. 添加文件或文件夹,如pics/battle-city.gif

  6. git add pics/battle-city.gif

  7. git commit -m “描述”

  8. git push -u origin master,输入用户名+密码

  9. 等待上传完成,若出现fatal: the remote end hung up unexpectedly为网络原因,重新执行push

  10. push时出现:

    failed to push some refs to 'https://github.com/Vae1997/BattleCity/'
    1
    2
    3
    4
    5
    hint: Updates were rejected because the remote contains work that you do
    hint: not have locally. This is usually caused by another repository pushing
    hint: to the same ref. You may want to first integrate the remote changes
    hint: (e.g., 'git pull ...') before pushing again.
    hint: See the 'Note about fast-forwards' in 'git push --help' for details.```

    为仓库已经更新,本地不是最新的仓库
    执行:git pull origin master,拉取最新仓库后接着push