赞
踩
1.github新建仓库
New respository->给Repository name *,起名如test,选择Private或者Public->Add A README file前打勾对号->点击Create repository按钮,仓库创建成功
2.命令行操作
git clone 仓库地址.git,让输入仓库名称和密码,如输入用户名:HelloWorlds-coder,但输入密码后报错显示,remote:Support for password authentication was removed on August 12,2021.Please use a personal access token instead.大概意思:你原先的密码凭证从2021年8月13日开始就不能用了,必须使用个人访问令牌(personal access token),就是把你的密码替换成token
1.setting->2.Developer setting->3.personal access tokens->4.Tokens(classic)->5.点击右边的创建New personal access token(Note自己起名如test->30 days->Select scopes打勾repo,以及delete_repo)
即设置token的有效期,访问权限等
注意:
记得把你的token保存下来,因为你再次刷新网页的时候,你已经没有办法看到它了,所以我还没有彻底搞清楚这个token的使用,后续还会继续探索!
之后用自己生成的token登录,把上面生成的token粘贴到输入密码的位置,然后成功push代码!
也可以 把token直接添加远程仓库链接中,这样就可以避免同一个仓库每次提交代码都要输入token了:
git remote set-url origin https://<your_token>@github.com/<USERNAME>/<REPO>.git
<your_token>:换成你自己得到的token
:是你自己github的用户名
:是你的仓库名称
此段主要借鉴:remote: Support for password authentication was removed on August 13, 2021. Please use a personal ac_镇杰。的博客-CSDN博客再就是命令行直接操作:
git clone 仓库地址(https://github.com/HelloWorlds-coder/test.git)->输入github名称,上面获得的token作为密码,本地pull就可以在本地看到test文件夹了->在命令行创建文件如:vi test.py,vi test.txt,->ls->git status->git add test.py test.txt(或者git add *)->git status->git commit -m '提交补充' ->git push->刷新github仓库就可以看到上传的文件了,这段主要也是借鉴教学视频
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。