git GitHub:是否可以在私人要点上与某人合作?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4050798/
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
GitHub: Is it possible to collaborate with someone on a private gist?
提问by znq
I have a private gist. If I send the URL to a friend he can view it, but cannot edit it, unless he forks it.
我有一个私人要点。如果我将 URL 发送给朋友,他可以查看它,但不能编辑它,除非他分叉。
Is there a way to edit it directly without forking it?
有没有办法直接编辑它而无需分叉?
采纳答案by VonC
2010: I am not sure it is possible.
To make a gist public (which is not what you want, but illustrates the lack of management features around gist), the only solution was to re-post it.
2010 年:我不确定这是否可能。
为了使 gist 公开(这不是您想要的,但说明了 gist 缺乏管理功能),唯一的解决方案是重新发布它。
There doesn't seem to be a GUI for adding public ssh key for collaborators, like there is for a GitHub project.
似乎没有用于为协作者添加公共 ssh 密钥的 GUI,就像 GitHub 项目那样。
Since my original answer in 2010, the ability to fork a gist(as mentioned in Avi Flax's answer) was added (around 2014-2015).
自从我在 2010 年的原始答案中,添加了分叉要点的能力(如Avi Flax的答案中所述)(大约在 2014-2015 年)。
Each gist indicates which forks have activity, making it easy to find interesting changes from coworkers or complete strangers.
每个要点都表明哪些分叉有活动,从而可以轻松地从同事或完全陌生的人那里找到有趣的变化。
See for instance "A basic collaboration workflow on Gist" (Apr. 2015) from Giovanni Cappellotto(potomak
on GitHub).
例如,参见Giovanni Cappellotto(在 GitHub 上)的“ Gist 上的基本协作工作流程”(2015 年 4 月 )。potomak
There is no direct pull request supported though(still valid in 2020).
虽然不支持直接拉取请求(2020 年仍然有效)。
回答by Avi Flax
No. Your friend should fork the repo, and make her changes there.
不。你的朋友应该 fork 回购,并在那里进行更改。
You can then merge in your friend's commits by:
然后,您可以通过以下方式合并您朋友的提交:
- Clone your gist repo locally
- Add your friend's fork as a remote
- e.g. if your friend is named Cindy:
git remote add-url cindy https://gist.github.com/cindy/df03bdacaef75a80f310
- e.g. if your friend is named Cindy:
- Fetch your friend's commits:
git fetch cindy/master
- Merge your friend's changes into your repo:
git merge cindy/master
- Push the changes back to GitHub:
git push origin/master
- 在本地克隆你的 Gist 仓库
- 将您朋友的叉子添加为遥控器
- 例如,如果您的朋友名为 Cindy:
git remote add-url cindy https://gist.github.com/cindy/df03bdacaef75a80f310
- 例如,如果您的朋友名为 Cindy:
- 获取你朋友的提交:
git fetch cindy/master
- 将您朋友的更改合并到您的仓库中:
git merge cindy/master
- 将更改推送回 GitHub:
git push origin/master
回答by seancdavis
Avi's approach is right, but the commands did not work for me. Using the same example Avi started, after I cloned my repo, I ran these commands from inside the gist repo directory:
Avi 的方法是正确的,但命令对我不起作用。使用相同的示例 Avi 开始,在我克隆我的 repo 之后,我从 gist repo 目录中运行这些命令:
$ git remote add cindy https://gist.github.com/cindy/df03bdacaef75a80f310
$ git fetch cindy master
$ git merge cindy/master
$ git push origin master
I wrote up a more detailed process for collaborating on gists here.
我在这里写了一个更详细的协作要点的过程。
回答by helpse
It's not possible. However, there is a way to easily re-post the Gist. It's explaned in here: http://chris.dzombak.name/blog/2011/05/making-private-gist-public.html
这是不可能的。但是,有一种方法可以轻松地重新发布 Gist。它在这里解释:http://chris.dzombak.name/blog/2011/05/making-private-gist-public.html
UPDATE
更新
You can now make gists public/private. Github implemented this feature some time ago.
您现在可以将要点设为公开/私有。Github 前段时间实现了这个功能。