I have a gist on GitHub that someone forked and made changes to. I like their changes.
Is there a way to merge the changes back into my original gist?
With the URL in your clipboard, open the Gist Dev menu and select the Clone a Gist Repository item. You will then be presented with an input field where you can paste the URL copied from GitHub. Click the Clone button or press enter, and the repository will be cloned to your computer.
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. We also can share a gist in multiple ways.
A gist operates like any other repository. So let's say you've cloned something like git://gist.github.com/2322786.git:
$ git clone [email protected]:2322786.git
(If you just wanted to try this without pushing, you can use git://gist.github.com/2322786.git
, which will demonstrate the merge principle and works anonymously, but does not allow you to push.)
And now you want to merge in changes from git://gist.github.com/2661995.git. Add it as an additional remote:
$ git remote add changes git://gist.github.com/2661995.git $ git fetch changes
And then merge in the changes like this:
$ git merge changes/master
And you should be all set. This should work regardless of whether the new gist was forked from yours at some previous point or is completely unrelated.
Taking Romain's comment into account, you would then issue a push
:
$ git push
This would only work if your original clone URL allows writing.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With