开发者

GitHub: Is it possible to collaborate with someone on a private gist?

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.

Is there a way to edit it directly without forking it?


No. Your friend should fork the repo, and make her changes there.

You can then merge in your friend’s commits by:

  1. Clone your gist repo locally
  2. Add your friend’s fork as a remote
    1. e.g. if your friend is named Cindy: git remote add-url cindy https://gist.github.com/cindy/df03bdacaef75a80f310
  3. Fetch your friend’s commits: git fetch cindy/master
  4. Merge your friend’s changes into your repo: git merge cindy/master
  5. Push the changes back to GitHub: git push origin/master


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.

There doesn't seem to be a GUI for adding public ssh key for collaborators, like there is for a GitHub project.


Since my original answer in 2010, the ability to fork a gist (as mentioned in Avi Flax's answer) was added (around 2014-2015).

Each gist indicates which forks have activity, making it easy to find interesting changes from coworkers or complete strangers.

GitHub: Is it possible to collaborate with someone on a private gist?

See for instance "A basic collaboration workflow on Gist" (Apr. 2015) from Giovanni Cappellotto (potomak on GitHub).

There is no direct pull request supported though (still valid in 2020).


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:

$ 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.


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

UPDATE

You can now make gists public/private. Github implemented this feature some time ago.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜