【GIT】git使用的技巧

一、git push 报错

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 。。。。。。

总结一下就是github从7-13号开始就不再使用账户名字进行登录了,使用token…

二、生成token

1、settings
在这里插入图片描述
2、develop settings
在这里插入图片描述
3、生成
在这里插入图片描述
4、随便写个标签
勾选repo 和 dele

在这里插入图片描述
在这里插入图片描述
5、这里的token是唯一的,记住这个token,丢了就得重新生成,每次提交代码都需要这个token。

三、使用token的git push或者clone

1、git push 本地有文件的情况

在工程目录中:

git remote set-url origin https://[email protected]/name/project.git
token //换成你生成的token
name //你的github name
project //你的工程名称

然后git push 就成功了,这样就不用每次都写token

2、git clone

git clone https://[email protected]/name/project.git
token //换成你生成的token
name //你的github name
project //你的工程名称

然后git push 就成功了,这样就不用每次都写token

四、git 加速

猜你喜欢

转载自blog.csdn.net/qq_37280428/article/details/129903972