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

相关推荐
刘马想放假9 分钟前
Git 从入门到进阶:一篇吃透版本管理的实战指南
git·gitlab
心中有国也有家32 分钟前
AtomGit Flutter 鸿蒙客户端:呼吸练习的完整生命周期
学习·flutter·华为·harmonyos
Zeeland34 分钟前
构建护城河:自学习 Agent
学习
brave_zhao1 小时前
nginx的进程架构
java·学习·nginx
枫零NET1 小时前
跟着OpenCode学习Pi Coding Agent-05-Agent的类型系统
人工智能·学习
Day(AKA Elin)1 小时前
【Day】MTP(Multi Token Prediction)技术学习
python·深度学习·学习·llama
Waay1 小时前
Linux 三个核心环境变量配置文件、作用域、生效方式完整梳理
linux·运维·学习·云原生·容器
Piko6142 小时前
锐捷交换机 DHCP Server部署
运维·网络·笔记
开发者联盟league2 小时前
git commit报错No .pre-commit-config.yaml file was found
git
枫零NET2 小时前
跟着OpenCode学习Pi Coding Agent-06-Agent循环
学习