如何授予 git 从 bash 推送的权限?
How to grant permission for git push from bash?
我正在尝试从 git-bash 创建一个新的存储库。
我从 GitHub 界面创建了一个新代表
,然后 运行 以下来自 bash
echo "# hello-world" >> README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/leoUninova/hello-world.git
git push -u origin master
并得到错误 'Permission denined':
~/tryal (master)
$ git push -u origin master
remote: Permission to leoUninova/hello-world.git denied to lqpwoeiruty.
fatal: unable to access 'https://github.com/leoUninova/hello-world.git/': The requested URL returned error: 403
我看到了类似问题的答案:getting error after run git push -u origin master command,但是它建议拉动,我认为这不是解决方案,因为我只是从 GitHub.[=17 复制了代码=]
编辑
我的问题是通用凭据,当我将它们设置为此 (使用密码而不是空白)时,它工作正常。
试试这个命令:
git remote set-url origin git@github.com:leoUninova/hello-world.git
然后试试你的 git push -u origin master
.
如果这不能解决您的问题,请尝试删除您存储的 git 凭据。
在 Windows 上转到 Control Panel > User Accounts > Credential Manager > Windows Credentials > Generic Credentials
并删除 Github
键。
我正在尝试从 git-bash 创建一个新的存储库。
我从 GitHub 界面创建了一个新代表
,然后 运行 以下来自 bash
echo "# hello-world" >> README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/leoUninova/hello-world.git
git push -u origin master
并得到错误 'Permission denined':
~/tryal (master)
$ git push -u origin master
remote: Permission to leoUninova/hello-world.git denied to lqpwoeiruty.
fatal: unable to access 'https://github.com/leoUninova/hello-world.git/': The requested URL returned error: 403
我看到了类似问题的答案:getting error after run git push -u origin master command,但是它建议拉动,我认为这不是解决方案,因为我只是从 GitHub.[=17 复制了代码=]
编辑
我的问题是通用凭据,当我将它们设置为此
试试这个命令:
git remote set-url origin git@github.com:leoUninova/hello-world.git
然后试试你的 git push -u origin master
.
如果这不能解决您的问题,请尝试删除您存储的 git 凭据。
在 Windows 上转到 Control Panel > User Accounts > Credential Manager > Windows Credentials > Generic Credentials
并删除 Github
键。