Creating a new gist
- Go to https://gist.github.com/ and create a new gist
- Note that you need to include
extensionto enable automatic language markup
Add fileto add more files
Cloning the gist
- If you’ve enabled
2 factor authentication, you need to use
personal acccess tokenwith
https, or use
If you have enabled two-factor authentication, or if you are accessing an organization that uses SAML single sign-on, you must provide a personal access token instead of entering your password for HTTPS Git.
- You should enable
2 factor authentication. Read more https://help.github.com/articles/https-cloning-errors/#provide-access-token-if-2fa-enabled
- For example with my gist https://gist.github.com/onmyway133/c486939f82fc4d3a8ed4be21538fdd32 the
- Run git commands as normal
git remote add origin email@example.com:c486939f82fc4d3a8ed4be21538fdd32.git git clone
- You have branch
git push origin master
remote: Gist does not support directories.
- In my cases I’m using node, so I need to ignore
- Also need to untrack if necessary
git rm --cached -r . git add .