Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GitHub: How to add Gist to repository?

I'm new to GitHub and have some questions. I'm using the PullToRefreshView project from GitHub. I've created my own Fork. Using the GitHub for Mac, I've synchronized my own fork down to my computer.

On GitHub Gist I found a commit with some changes to one of the files from the original repository: https://gist.github.com/1611706. How can I add this to my own fork?

like image 787
dhrm Avatar asked Jan 16 '12 18:01

dhrm


People also ask

How do I edit my gist on GitHub?

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.

What is the difference between Gist and repository?

Gists are short snippets of code or notes which are useful to share instantly with any one. Usually it is one file hosted on GitHub gist. Whereas GitHub repos stores large amount of code. Group of people can contribute to that project.


1 Answers

Easy way:

  • Merge this Pull Request using the GitHub Merge button
  • Pull (synchronize) the changes from your GitHub repository.

Less easy way:

  • Display in your browser the raw version of the gist
  • Copy the content
  • Open locally the PullToRefreshView.m file
  • Replace its content with the content of the clipboard
  • Stage the new version of the file
  • Commit locally and push (publish) toward your GitHub repo

Note: There are other approaches, but considering the small history of the Gist, they're far too much complex.

Note 2: Please take into account that this change will only exist in your repo, not in the master (chpwn's) repo. You won't be able to transparently benefit from every upstream update, you'll have to merge them.

like image 144
nulltoken Avatar answered Sep 21 '22 18:09

nulltoken