我正在尝试将更改推送到新的存储库,我将错误视为
➜ xcode git clone git@github.com:hhimanshu/bnr.git
Cloning into 'bnr'...
remote: Counting objects: 3, done.
remote: Total 3 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (3/3), done.
Checking connectivity... done.
➜ xcode cd bnr
➜ bnr git:(master) vi README.md
➜ bnr git:(master) ✗ gst
On branch master
Your branch is up-to-date with 'origin/master'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: README.md
no changes added to commit (use "git add" and/or "git commit -a")
➜ bnr git:(master) ✗ git add README.md
➜ bnr git:(master) ✗ git commit -m "read.me"
[master ec737ea] read.me
1 file changed, 1 insertion(+)
➜ bnr git:(master) git push origin master
ERROR: Permission to hhimanshu/bnr.git denied to hhimanshu/IntroductionToIosProgramming.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
我真的不明白,为什么这个存储库在讨论hhimanshu/IntroductionToIosProgramming
,这是我的其他存储库
我还检查了我的git config
,我看到了
➜ bnr git:(master) git config --list
user.name=Harit Himanshu
user.email=mycorrectemail@yahoo.in
push.default=matching
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
core.ignorecase=true
core.precomposeunicode=true
remote.origin.url=git@github.com:hhimanshu/bnr.git
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.master.remote=origin
branch.master.merge=refs/heads/master
当我ssh git@github.com -v
时,我看到了
Hi hhimanshu/IntroductionToIosProgramming! You've successfully authenticated, but GitHub does not provide shell access.
我的用户名设置不正确,但我的用户名似乎正确
git config --global user.name
Harit Himanshu
有谁知道我在这里做错了什么?
答案 0 :(得分:0)
我猜你的user.name应该是:
user.name = hhimanshu
因为这是Github登录,不是描述性用户名
编辑: 当您对配置文件进行更改时,请不要忘记先重置上次提交并在更改后再次执行提交