Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

git

github

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?

like image 412
znq Avatar asked Oct 29 '10 09:10

znq


People also ask

Can private gist share?

Select the Secret option to create a secret gist. Secret gists are not searchable and do not show up in Discover. They can only be used for your own purposes, as you cannot share them.

Is Github Gist private?

Secret gists aren't private. If you send the URL of a secret gist to a friend, they'll be able to see it. However, if someone you don't know discovers the URL, they'll also be able to see your gist. If you need to keep your code away from prying eyes, you may want to create a private repository instead.

Can you edit a gist?

How Do I Edit or Delete a Gist? In the top right corner of your gist page, there will be a menu that allows for multiple functions to be performed on your gist. We can edit, delete, unsubscribe, star, embed, copy, share, and download a raw copy or zipped copy of a gist.


2 Answers

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
like image 194
Avi Flax Avatar answered Sep 25 '22 14:09

Avi Flax


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.

Gist forks -- https://help.github.com/assets/images/help/gist/gist_forks.png

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

like image 33
VonC Avatar answered Sep 21 '22 14:09

VonC