Can I make a pull request on a gist on GitHub?

GitGithubGistPull Request

Git Problem Overview


Can I make a pull request on some else's gist on GitHub?

I'm aware of the fork, clone and commit workflow for a gist I own. I'd like to know if I can request to update someone else's gist with my fork.

Git Solutions


Solution 1 - Git

You cannot currently open a pull request on a Gist.

You can comment though on the Gist and ask the author to update the Gist from your fork.

Solution 2 - Git

As @Kevin said, unfortunately GitHub doesn't expose a GUI for pull requests on gists. You can however fork the gist, make your changes in the fork, then share a link to your fork with the original author.

If the original author is keeping a local cloned repository of their gist (see https://stackoverflow.com/questions/2082723/how-do-you-manage-your-gists-on-github) then they can do a pull against your fork as a remote using the gist # (e.g. git://gist.github.com/1131276).

Solution 3 - Git

I have sent a feature request email to [email protected] and pointed to this question.

Ivan Žužak replied with the usual:

> I've added that to our feature request list so that the team can consider it.

confirming it is not possible.

Let's keep upvoting this question until it happens.

I recommend instead creating one regular repo called gists and ordering your gists into regular folders.

Solution 4 - Git

I don't think it is appropriate to have pull request on gists. The intent of gist.github.com was to improve upon the pastebin concept commonly used in IRC and forums. They chose to call the service "gist" because as vocabulary.com describes it...

> When you need a quick summary of the essentials, rather than the whole story or a thorough explanation, you're looking for the gist.

However I will concede that github is missing a very important feature. The ability to create a full github repo out of a gist and keep metadata about its origins.

That would solve most of what people need. At that point, the only form of "request" that someone would need to submit is "hey, won't you make a full repo out of this." And that can be done in the comments. By NOT allowing pull requests, issues, etc. on gists, it allows the author to reply to such a comment with, "nah, it was just a hack I threw together and don't intend to support."

StackOverflow won't let you link to pastebin without including a code block. Done.

Solution 5 - Git

Pulling Gists isn't possible in the same manner as git pull, one could provide the changes via Gist in the form of a .diff/.patch. This can be done locally in your working directory with [diff][1] or via GitHub if it's already forked there:

This way, it's differential and a lot easier to view/apply the changes, especially if it affects multiple files.

[1]: http://linux.die.net/man/1/diff "diff(1) - Linux man page"

Solution 6 - Git

I too would very much appreciate the capability to make (or receive) pull requests to/from gists.

Since it's not possible to make a pull request to a gist, I have found that the best alternative is to simply write the contents of the gist in a standard GitHub repository README.md file.

That will:

  • appear visually very similarly to a gist, and
  • can be forked just like a gist, but
  • changes made to the forks can be pull request-ed back to the original (desired behaviour)

Although it doesn't let you PR to a gist, I hope it helps somewhat.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionRazvan CalimanView Question on Stackoverflow
Solution 1 - GitKevin SawickiView Answer on Stackoverflow
Solution 2 - GitstudgeekView Answer on Stackoverflow
Solution 3 - GitCiro Santilli Путлер Капут 六四事View Answer on Stackoverflow
Solution 4 - GitBruno BronoskyView Answer on Stackoverflow
Solution 5 - GitAlastairView Answer on Stackoverflow
Solution 6 - GitstevecView Answer on Stackoverflow