无法访问远程git存储库 [英] Cannot access remote git repository
问题描述
我通过github网站的新建按钮创建了一个git repo。然后我用git bash来设置我的本地仓库,并试图拉我的远程仓库(它有默认的README),但得到了访问被拒绝的错误,与此问题中看到的一样:
无法推送到git存储库 - 权限被拒绝
我遵循 https://help.github.com / articles / set-up-git#platform-windows ,甚至重新打开了一个新的git bash会话,但我仍然在我的远程回购中出现访问错误。我 chmod 777
在我的本地仓库中,所以它也不是本地问题。
-
https://github.com/new
来创建我的新远程仓库。 - 在我的win7计算机上打开git bash并执行以下命令:项目目录中的
-
git init
-
git add。
递归添加所有项目文件 -
git commit -am提交消息
git remote add origin https:// ... 产生fatal:remote origin already exists。 -
git pull origin master
产生访问被拒绝错误。我先用ssh尝试了第4步,现在我正在尝试使用https。
-
编辑:为了解决您现在检查您的uri的问题,因为它可能像拼写错误一样简单
使用检查当前配置git config -l </ code>
可能更改为 git remote set-url origin git @ github .com:path / torepo.git
查看更多在这里。
I created a git repo via the github website's "new button". Then I used git bash to set up my local repo and tried to pull my remote repo (it had the default README) but got an "access denied error", the same one seen in this question: Cannot push to git repository - permission denied
I followed https://help.github.com/articles/set-up-git#platform-windows, even reopened a new git bash session but I still get access errors on my remote repo. I chmod 777
on my local repo so it's not a local problem either.
https://github.com/new
to create my new remote repo.- Opened git bash on my win7 computer and executed the following commands:
git init
in project directorygit add .
to recursively add all project filesgit commit -am "commit message"
git remote add origin https://...
produces "fatal: remote origin already exists".git pull origin master
produces access denied error. I tried step 4 first with ssh, now I'm trying to use https.
To get push permissions I would use the ssh protocol/uri when doing the first git clone
(since that avoids some config troubles)
Edit: To possible fix the issues you are now having check your uri since it might be as simple as a spelling mistake
Check current configuration with git config -l
Possibly change with git remote set-url origin git@github.com:path/torepo.git
See more here.
这篇关于无法访问远程git存储库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!