简体   繁体   中英

Git Push fails permission issue for git account

I have two github account and when I try to clone and push, for some reason it fails with permission denied.

I have configured my ssh keys and I can verify that ssh works with

ssh -vvv git@github.com


git push -u origin

remote: Permission to <user-name-2>/test-config.git denied to <user-name-1>.
fatal: unable to access 'https://github.com/<user-name-2>/test-config.git/': The requested URL returned error: 403

You're attempting to push to a repository you are not allowed to push to. Check whether you have filesystem permissions on the server. If you're really trying to push to another users account on GitHub, afaik this is not allowed.

You must use the key of the other user. The following two Stack Overflow questions have answers about how to do something like this:

我从这个帖子得到了我的问题的答案推送到Git返回错误代码403致命:HTTP请求失败

git remote set-url origin https://yourusername@github.com/user/repo.git

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM