将git与github一起使用:`远程:对用户名 project.git拒绝对myname的权限



i分叉了一个我正在尝试做出贡献的现有项目,

我试图以最简单的方式做到这一点。来自覆盆子Pi。我更改了电子邮件地址和项目名称以简单

我不明白为什么这不起作用,新存储库位于 https://github.com/username/project

请帮助我了解缺少的内容,在线找到GitHub的说明不够

pi@raspberrypi:~ $ git config --global user.name "username"
pi@raspberrypi:~ $ git config --global user.email "username@email.com"
pi@raspberrypi:~ $ git clone https://github.com/username/project
Cloning into 'project'...
remote: Enumerating objects: 23, done.
remote: Counting objects: 100% (23/23), done.
remote: Compressing objects: 100% (18/18), done.
remote: Total 1450 (delta 9), reused 16 (delta 5), pack-reused 1427
Receiving objects: 100% (1450/1450), 2.28 MiB | 0 bytes/s, done.
Resolving deltas: 100% (1019/1019), done.
pi@raspberrypi:~ $ cd project
pi@raspberrypi:~/project $ git add --all
pi@raspberrypi:~/project $ git commit -am "mychange"
[master 1732397] mychange
 20 files changed, 2613 insertions(+), 2248 deletions(-)
 create mode 100644 newfile.cpp
pi@raspberrypi:~/project $ git push
Username for 'https://github.com': username@email.com
Password for 'https://username@email.com@github.com':
remote: Permission to username/project.git denied to myname.
fatal: unable to access 'https://github.com/username/project/': The request                                                        ed URL returned error: 403

github要求的用户名不应是电子邮件地址。(username@email.com)它应该是您的github用户帐户名称。

除非您激活2FA,在这种情况下,用户名仍然是您的github帐户,但是您的密码将是PAT(个人访问令牌)

最新更新