Skip to content

Instantly share code, notes, and snippets.

@RichardBronosky
Forked from antichris/about.md
Last active November 14, 2019 17:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RichardBronosky/fcc543f7f1cfba404caf5ce276cc0951 to your computer and use it in GitHub Desktop.
Save RichardBronosky/fcc543f7f1cfba404caf5ce276cc0951 to your computer and use it in GitHub Desktop.
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