1. 创建新项目
    在这里插入图片描述

  2. 添加项目名称并确定
    在这里插入图片描述

  3. 下面的链接保存
    在这里插入图片描述

  4. 选中需要上传的文件夹=>右键open git bash here
    在这里插入图片描述

  5. git init初始化,这里会生成一个.git文件,如果打开没有,点击查看,勾选隐藏的项目
    在这里插入图片描述

  6. git add .进行添加,git status查看状态
    在这里插入图片描述

  7. git commit -m "first commit"这里提交会不成功,如果是第一次可能需要输入 git config --global user.name "your name"git config --global user.email "your email"
    在这里插入图片描述

  8. 复制步骤3的链接然后运行如下代码git remote add origin https://github.com/........

在这里插入图片描述
9. 最后运行git push -u origin master第一次运行需要输入github密码,按提示输入就行
在这里插入图片描述
添加成功
在这里插入图片描述

可能的问题:

  1. warning: in the working copy of ‘ppocr_keys_v1.txt’, LF will be replaced by CRLF the next time Git touches it

解决方法:输入git config --global core.autocrlf inputHow to Deal with the Git Warning: LF will be Replaced by CRLF
2. fatal: remote origin already exists报错window就是步骤三复制链接有问题或者想要替换时如何删除之前错误的地址

解决方法:remote origin already exists远程分支已经存在,故报错!git remote rm origin然后重新添加正确的分支git remote add origin xxx

Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐