前言:因为想要在把自己写的项目存起来,就在github上创建了个仓库。。。结果莫名其妙的一堆问题。。。。。🤕🤕
1.首先,请大家登录自己的账号。我不知道已经忘记密码多少回了。。。。😵?💫😵?💫如果忘记,就请点击【忘记密码】🤭。。
2.新建个仓库
  可勾可不勾,反正我没勾🙃,正常填写,最后点击【create repository】
3.创建成功后,就会有个仓库地址,直接克隆就可以。我clone的是https的地址,以下操作也是对于https 克隆方式。
 在终端执行:
git clone 👆上面的地址
克隆之后的文件夹里在你没有在远程创建任何文件的情况下,只有一个.git文件
4.你需要把你本地的项目文件复制到clone下来的文件夹中。
5.之后是一堆终端操作。
git add .
git commit -m '首次提交'
git push origin main
注意是main分支,不是master!!! 
在push的过程中会要求输入username和password username 就是你登录github的用户名 password 是你申请的token!!!!!
申请token如下: 

    最后点击【Generate token】即可生成token,复制保存下来,因为下次再进来不会有了,以防你以后会用到。 回到最上面👆,你push时要求输入的密码就是这个token
我之前想采用的方式是: 创建远程仓库->在我本地项目文件夹下 git init->在本地项目文件夹下git remote add origin 克隆的地址->然后git add . 和git commit -m '首次提交’及git push origin master 但是就是都是问题,还得配置什么代理吧啦吧啦的。。。。。没搞懂,不知道怎么回事😤🤬。。。。换了上面的方式就成功了😐。在gitee上用这种也是有问题,换上面的也成功了😑。 参考链接:https://blog.csdn.net/qq_25737169/article/details/119735977
|