git 有人可以在github上推送我的项目吗?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/17442930/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Can anybody push to my project on github?
提问by Silvery
I am new to git as well as github. I set up a repo on github, and I can push local stuff to this remote repo. Now here is the question: just after I push something to the remote repo, and I refresh the page, I can see the changes are uploaded(for example, if I wrote a readme.txt and push it to the remote repo, where such a readme.txt did not exist, after push and refresh the page, it appears).
我是 git 和 github 的新手。我在 github 上建立了一个 repo,我可以将本地的东西推送到这个远程 repo。现在的问题是:在我将某些内容推送到远程存储库并刷新页面之后,我可以看到更改已上传(例如,如果我编写了一个 readme.txt 并将其推送到远程存储库,例如readme.txt 不存在,推送刷新页面后出现)。
So can anybody change my repo on github freely? Or if I push something to linux kernal, can the changes I made be added to it and public for all?
那么任何人都可以自由更改我在 github 上的 repo 吗?或者,如果我将某些内容推送到 linux kernal,我所做的更改是否可以添加到其中并对所有人公开?
回答by Sébastien Dawans
No, all repositories are read-only for anonymous users. By default only the owner of the repository has write access. If you can push to your own repo, it's because you are using one of the supported authentification methods (HTTPS, SSH, ...).
不,所有存储库对于匿名用户都是只读的。默认情况下,只有存储库的所有者具有写访问权限。如果您可以推送到您自己的存储库,那是因为您正在使用一种受支持的身份验证方法(HTTPS、SSH 等)。
If you want to grant someone else privileges to push to your repo, you would need to configure that access in the project settings.
如果您想授予其他人推送到您的存储库的权限,您需要在项目设置中配置该访问权限。
To contribute to projects in which you don't have push access, you push to your own copy of the repo, then ask for a pull-request. Linux is not a good example for that, because the kernel developers do not use GitHub pull requests.
要为您没有推送访问权限的项目做出贡献,您可以推送到您自己的存储库副本,然后请求拉取请求。Linux 不是一个很好的例子,因为内核开发人员不使用 GitHub 拉取请求。
回答by Einar
No, but if the repository is public others can fork it, commit to their own fork.
不,但如果存储库是公共的,其他人可以将它分叉,提交到他们自己的分叉。
They can then ask you to pull some of the changes in their fork into your repository via a pull-request.
然后他们可以要求您通过拉取请求将他们分叉中的一些更改拉入您的存储库。
回答by hd84335
Nobody can push directly to your repository if you are not already granting them write access.
如果您尚未授予他们写访问权限,则没有人可以直接推送到您的存储库。
The process for contributing to a public repository in GitHub starts by forking the repository, then pushing the change onto the forked, then creating a pull request onto the original repository. After that comes the role of the project owner to review and take action (merge/decline) of the requested code change.
为 GitHub 中的公共存储库做出贡献的过程首先对存储库进行分叉,然后将更改推送到分叉上,然后在原始存储库上创建拉取请求。之后是项目所有者的角色来并采取行动(合并/拒绝)所请求的代码更改。
For more details, please check the below helpful article:
有关更多详细信息,请查看以下有用的文章:
https://akrabat.com/the-beginners-guide-to-contributing-to-a-github-project
https://akrabat.com/the-beginners-guide-to-contributing-to-a-github-project