Search code examples
gitgithubgithub-for-mac

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?


Solution

  • Easy way:

    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.