1

我是 Git 新手,所以我正在努力学习 git。同时,当我在 Git 上工作时,

错误:对用户名/file.git 的权限拒绝给 Username1。致命:无法从远程存储库中读取。

请确保您具有正确的访问权限并且存储库存在。

我遇到了这个错误。顺便说一句,文件是只读的。怎么推?

  • git clone git@github.com:username/file.git
  • git 添加文件.txt
  • 混帐添加。
  • git commit -a -m "第二次提交"
  • git push git@github.com:username/file.git

顺便说一下 git config

[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
precomposeunicode = false
[remote "origin"]
url = git@github.com:username/files.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master
4

1 回答 1

1

If you want to clone other one's repo and make some contributions to it, you need to fork the repo as your own first. Push commits to your own repo and you can send a "Pull Request" to the original author then.

git clone git@github.com:username/file.git

Here the username must be yours, or an org that you are in. Otherwise, you don't have the permission to update the repo.


B.t.w, a tip for you. You can

$ git remote add origin git@github.com:username/file.git
$ git push -u origin master

Since then you can push it simply by

$ git push
于 2012-12-21T03:06:46.180 回答