http实现
生成令牌并保存
打开终端并导航到你已经克隆的仓库目录
更新远程URL: 使用生成的个人访问令牌更新远程URL。假设你的Gitee用户名是yourusername
,生成的令牌是your_token
,仓库名是yourrepository
:
git remote set-url origin https://wynyibo:0e22ce4b4d81bfe9e1cca452a70c4e99@gitee.com/wynyibo/PilotGo-plugin-topology.git
git remote set-url origin https://yourusername:your_token@gitee.com/yourusername/yourrepository.git
你可以运行以下命令来验证远程URL是否更新成功,输出应该显示更新后的URL
git remote -v
为了避免每次推送代码时都输入令牌,可以配置Git记住凭证:
git config --global credential.helper store
重新推送
git push