Skip to content

Instantly share code, notes, and snippets.

Embed
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 https://gist.github.com/ishu3101/6fb35afd237e42ef25f9

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 https://github.com/ishu3101/ConvertTo-Markdown

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.

@wooden-utensil

This comment has been minimized.

Copy link

wooden-utensil commented Mar 23, 2019

Very cool!

@suntong

This comment has been minimized.

Copy link

suntong commented Jun 24, 2019

Thanks!

@jbbarre

This comment has been minimized.

Copy link

jbbarre commented Mar 19, 2020

perfect! thanks

@Antar74

This comment has been minimized.

Copy link

Antar74 commented Apr 24, 2020

being a noob like myself I got an error trying to follow these steps :(

I got stuck in git remote, first got an error and I panicked and did not write it down but it stated my repository was not empty and prompted me to make a pull first. Then instead of a pull I quit and started my command line again (using mac terminal). Created a new repository as the 4th steps ask, and got stuck again but now with a message that says "remote GitHub already exists. Please help!

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.