刚刚换了电脑,准备往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了!