git push-u源主机失败,遇到权限被拒绝的问题
我在git push-u源主机失败,遇到权限被拒绝的问题,git,github,rstudio,Git,Github,Rstudio,我在Rstudio中创建了新项目,并打开了github项目存储库。但是,我打算将我的所有项目实施推到github页面,但Git投诉有以下错误: $ git push -u origin master remote: Permission to JulaitiShayiding/mspc.git denied to julaiti. fatal: unable to access 'https://github.com/JulaitiShayiding/mspc.git/': The reques
Rstudio
中创建了新项目,并打开了github
项目存储库。但是,我打算将我的所有项目实施推到github
页面,但Git
投诉有以下错误:
$ git push -u origin master
remote: Permission to JulaitiShayiding/mspc.git denied to julaiti.
fatal: unable to access 'https://github.com/JulaitiShayiding/mspc.git/': The requested URL returned error: 403
我使用这些git命令来实现这一点:
cd /path/to/my/repo
rm -rf .git
git init
git add --all
git commit -m "Initial commit"
git remote add origin "https://github.com/JulaitiShayiding/mspc.git"
$ git pull --rebase origin master
git push -u origin master
$ git pull origin master
编辑:
我尝试使用git add.gitignore
添加.gitignore
文件,但仍然无法解决权限被拒绝的问题。.gitingore
文件包含以下内容:
.Rproj.user
.Rhistory
.RData
我查看了
SO
中的相关帖子,并尝试了所有这些帖子,但仍然无法解决我的问题。有人能帮我解决这个问题吗?如何修复此错误?有什么想法吗?提前感谢:)看起来您没有权限推送到存储库https://github.com/JulaitiShayiding/mspc.git/
。要推送到存储库,您必须是存储库的所有者或存储库的合作者。要执行此操作,请转到存储库设置并将自己添加为协作者,或要求所有者将您添加为协作者
如果它不是您的存储库,并且您无法获得协作者,您可以将存储库转移到您的帐户,进行一些更改,然后创建对原始存储库的请求。然后,此拉取请求必须由存储库的所有者或合作者接受。@datageek推送时是否提供了GitHub凭据?@datageek尝试执行
git remote set url originhttps://yourusername@github.com/user/repo.git
,然后在pushing@datageek请验证您的.gitconfig
(在Windows上的C:\Users\USERNAME\.gitconfig
下)中是否存在正确的名称和电子邮件地址(与您在GitHub注册时使用的信息相同)。您验证了.gitconfig
中指定的名称吗?让我们来看看。