Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Transfer a gist to a GitHub repository

Transfer a gist to a GitHub repository

clone the gist

git clone

rename the directory

mv 6fb35afd237e42ef25f9 ConvertTo-Markdown

change the working directory to the newly renamed directory

cd ConvertTo-Markdown

create a new repository on github
add the github repository as a remote to your checked out gist repository

git remote add github

push to the new repository on github

git push github master

rename the remote of gist

git remote rename origin gist

Each time you make changes (or pull changes from github/gist), you can do
git push github master   # To github
git push gist master     # To gist

This will also push back your changes to the gist and not only the github repo.

Copy link

babakfp commented May 28, 2022

Does it work fine with a gist containing images and videos?

Copy link

CCXXXI commented Sep 1, 2022

Copy link

Thanks 👍

Copy link

Gesugao-san commented Dec 26, 2022

Error while this:

$ git push github master
error: src refspec master does not match any
error: failed to push some refs to '<redacted>/<redacted>'

But ok when this:

$ git push github
Enumerating objects: 3, done.
Counting objects: 100% (3/3), done.
Delta compression using up to 8 threads
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 757 bytes | 757.00 KiB/s, done.
Total 3 (delta 0), reused 3 (delta 0), pack-reused 0
 * [new branch]      main -> main

Copy link

endolith commented Jan 27, 2023

@CCXXXI Yeah that's way easier. Just one step, no local copy or command line needed.

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