Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Merge someone's fork of your gist into your gist

How to merge someone's fork of your gist into your gist

I created a gist, then someone else forked it and improved it. With a full repository, I might get their improvements in a pull request. But that isn't availabe for gists.

This is how to get their changes into my gist.

  1. Clone your own gist

     git clone
  2. Rename your gist's git folder for easy reference

    See for your OS


     rename "YOUR_GIST_ID_GOES_HERE" "gisty-mcgistface"
  3. Change directory to go into that folder

     cd gisty-mcgistface
  4. Add their gist as a branch

     git remote add THEIRUSERNAME
     git fetch THEIRUSERNAME
     git checkout -b THEIRUSERNAME-master THEIRUSERNAME/master
  5. Switch back to your master branch

     git checkout master
  6. Merge their gist into yours

     git merge THEIRUSERNAME-master
  7. Push the newly merged gist back to GitHub

     git push

This comment has been minimized.

Copy link

@Roy-Orbison Roy-Orbison commented Sep 4, 2021

You can condense steps 1 & 2 into

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment