当前位置:   article > 正文

【git】Windows使用git bash上传文件到github,解决git push失败,使用token上传github_something went really wrong, and we can鈥檛 process

something went really wrong, and we can鈥檛 process that file.

    昨天写了个特征脸的小Demo,短小精悍,于是想放到github上。

    但网页上传总会提示 "Something went really wrong, and we can’t process that file."

    于是自学了如何使用git bash,这里记录以备不时之需。

附:git bash Windows 下载地址:Git for Windows

        安装教程随便网上找一篇就好了,不多说。

这个是自学git bush 使用本地仓库及远程仓库的全过程,强烈推荐观看!!很有用!!

How to upload files to github from Git Bash on Windows from scratch_哔哩哔哩_bilibili

这里作者使用了以下几个命令

 1. 建立本地仓库

git init # 在要上传文件的文件夹使用,建立本地仓库

 2. 连接远程仓库

  1. git remote add origin <gitlink> # 这里放远程仓库的链接
  2. git remote -v #查看是否连接成功

 3. 向缓冲区中加入要上传的文件

git add . # 使用.表示将此文件夹下的所有文件上传到缓冲区,可用想单独上传的文件名代替

4. 写更新日志

git commit -m "YOUR COMMENTS" # 双引号中写你想要写的日志 可以使用 "First commit"

 5. 将缓冲区中的文件送到远程仓库中

git push origin master # 直接push即可

之后会弹窗让输入github的Username和password

password在2021年8月后不支持使用了,这里的password要使用token代替

token的位置

1. settings

2.左侧的Developer settings

3.创建一个新token

4.得到token

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/2023面试高手/article/detail/463358
推荐阅读
相关标签
  

闽ICP备14008679号