Git Push 403

这个问题会在出现登录提示之后出现,我输入帐号密码以及Personal access tokens都没有用。

$ git push origin main
warning: ----------------- SECURITY WARNING ----------------
warning: | TLS certificate verification has been disabled! |
warning: ---------------------------------------------------
warning: HTTPS connections may not be secure. See https://aka.ms/gcmcore-tlsveri
fy for more information.
remote: Permission to ByteLegendQuest/fix-typo.git denied to whitea-tree.
fatal: unable to access 'https://github.com/ByteLegendQuest/fix-typo.git/': The
requested URL returned error: 403

  1. 找到 .git 文件夹 如果是 mac 需要在项目文件 按下 shift + command + . 三个按钮,你将会看到隐藏文件。

  2. 找到 git 文件夹 内的 config 文件,找到下面这段代码 标橙色的 域名。

    [remote "origin"]
    url = https://github.com/J-Boss-Os/J-Boss-Tool.git
    fetch = +refs/heads/*:refs/remotes/origin/*
    [branch "master"]
    
  3. 把域名替换成,账户@密码 后保存

    [remote "origin"]
    url = https://账户@密码/J-Boss-Os/J-Boss-Tool.git
    fetch = +refs/heads/*:refs/remotes/origin/*
    [branch "master"]
    

应该是最开始clone的时候没有注意,直接clone了原地址。

posted on   白茶木  阅读(250)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 别再用vector<bool>了!Google高级工程师:这可能是STL最大的设计失误
· 单元测试从入门到精通
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 上周热点回顾(3.3-3.9)
点击右上角即可分享
微信分享提示