美文网首页
解决git push 中remote: Permission t

解决git push 中remote: Permission t

作者: BigP | 来源:发表于2020-05-15 10:59 被阅读0次

    问题复现

    你在切换多个github账号的时候,很容易出现下面的这种问题

    问题描述

    今天我在使用git push 将修改的项目push到github中,出现:

    remote: Permission to xxxxx.git denied to xxx.fatal: unable to access 'https://github.com/ xxxxx.git/': > The requested URL returned error: 403
    

    解决方案

    第一步,将github中的项目clone下来

    第二步,修改.git/cofig中的url

    cd 到项目中,编辑 .git/cofig中的url
    vim .git/config

    [remote "origin"]
    url = https://github.com/git的用户名/项目名称
    的url改为
    url = https://appleyuchi@github.com/appleyuchi/TPU_GPU_Code.git

    第三步,git push -u origin master

    这里附带记录一个小命令:

    git config --list

    相关文章

      网友评论

          本文标题:解决git push 中remote: Permission t

          本文链接:https://www.haomeiwen.com/subject/twoqohtx.html