Skip to content

Instantly share code, notes, and snippets.

Embed
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 https://github.com/defunkt/gist cli tool to do the next best thing.

Usage

gist-fork git@gist.github.com:fcc543f7f1cfba404caf5ce276cc0951.git
#!/bin/bash -eu
[[ -z ${1:-} ]] && \
echo -e "\n""Usage: $0 GIST_URL""\n" || \
GIST_URL="${1:-}"
: $GIST_URL
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.