从github clone代码的方式一般通过https方式,这种情况输入账号密码验证即可。
但是从2021年8月13日后,github删除密码鉴权,使用token来代替,会有下面的提示。
remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.
remote: Please see https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/ for more information.
下面介绍下token的使用方法:
1. 建立个人token。
github右上角进入/Settings/Developer settings/Generate new token页面
选择相应的权限,之后生成access token
2. 访问方式
git clone https://oauth2:your_token@github.com/username/projectname.git
红色不能改变,蓝色使用上面的生成token,绿色使用你的项目链接。