I have a Git repository on my computer with a single file coins.py
How can I get that as a Gist on Github, preserving history?
This is actually quite simple. You can move your existing history into a Gist repo like you would move it into any other:
https://gist.github.com/<LONG-HEXNUMBER>.git
(if you prefer using SSH URLs, you can use git@gist.github.com:<THAT-SAME-HEXNUMBER>.git
instead)git remote add origin <URL>
, where origin
is an unused local name for the remotemaster
branch, you will want to overwrite the remote one with git push -f origin master