美文网首页
解决多用户时git push失败,Permission deni

解决多用户时git push失败,Permission deni

作者: overmindgc | 来源:发表于2017-12-31 20:40 被阅读172次

刚刚换了电脑,准备往github上提交的时候,因为这个电脑之前是别人的账号,push的时候会失败:

remote: Permission to overmindgc/GCFunnelChart.git denied to xxxxxx.
fatal: unable to access 'https://github.com/overmindgc/GCFunnelChart.git/': The requested URL returned error: 403

试了几个方法,最后找到了解决办法
修改git的config文件

vim .git/config

原来是这样的:

[core]
        repositoryformatversion = 0
        filemode = true
        bare = false
        logallrefupdates = true
        ignorecase = true
        precomposeunicode = true
[remote "origin"]
        url = https://github.com/overmindgc/GCFunnelChart.git
        fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
        remote = origin
        merge = refs/heads/master

修改url,在host前边加上你的github账号密码,用:和@分开

url = https://username:password@github.com/overmindgc/GCFunnelChart.git

保存以后,就可以正常push了!

相关文章

网友评论

      本文标题:解决多用户时git push失败,Permission deni

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