Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Fork your own Gist

Fork your own Gist

It used to be possible to fork your own gists via the browser using a little JS magic. This is no longer the case. As an alternative, you can use Chris Wanstrath's cli tool to do the next best thing.


#!/bin/bash -eu
[[ -z ${1:-} ]] && \
echo -e "\n""Usage: $0 GIST_URL""\n" || \
url="$(date | gist -f temp)"
git clone $url
cd $(basename $url)
git remote add alt $GIST_URL
git fetch alt
git reset --hard alt/master
git push -f origin master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.