git 问题解决记录

在用git上传文件到仓库中出现了2个问题

第一个问题:

需要修改git的代理端口与电脑自己的代理服务器设置中的端口和VPN的端口保持一致,

比如我的端口是7897,就设置

复制代码
git config --global http.proxy http://127.0.0.1:7897
git config --global https.proxy http://127.0.0.1:7897

配置好后,查看git配置

复制代码
git config --global --edit

第二个问题

修改.git/config中的url

复制代码
将
[remote "origin"]
url = https://github.com/git的用户名/项目名称
的url改为
url = https://git的用户名@github.com/git的用户名/项目名称

再push

最后就解决了

参考资料:

1.解决git push 中remote: Permission to xxxxx.git denied to xxx. fatal: unable to acce_remote: user permission denied fatal: unable to ac-CSDN博客

2.https://zhuanlan.zhihu.com/p/648164862

相关推荐
Patrick_Wilson3 小时前
为省一次回归测试,该不该把多个改动堆进一条分支?
git·ci/cd·架构
零陵上将军_xdr3 小时前
后端转全栈学习-Day5-JavaScript 基础-3
开发语言·javascript·学习
恋喵大鲤鱼3 小时前
git blame
git·git blame
yeflx3 小时前
Git操作
git
恋喵大鲤鱼3 小时前
git pull
git·git pull
05大叔4 小时前
对话系统学习,问答型数据库,闲聊型对话数据库
学习
nashane4 小时前
HarmonyOS 6商城开发学习:抢票倒计时与系统日历提醒——票务类场景的完整落地思路
学习·华为·harmonyos
咖啡星人k4 小时前
MonkeyCode 的 Git 集成:AI编程如何与版本控制无缝协作
git·ai编程·monkeycode
伶俜665 小时前
零基础学 ArkUI 传感器(专题二):从加速度计到指南针,玩转硬件能力
学习·华为·harmonyos