I am having trouble getting my CodePen code to the GitHub repository. I can create individual files with code copy/paste, but I know that isn’t right. PLEASE HELP!!!
What have you tried?
I have created new repository. I have exported the CodePen to the GitHub GIST, but that is where I lose it. I’m not sure how to link the two.
Gists are just for single code snippets, not whole repos.
What OS are you using? Have you installed Git?
I’m on Windows 10 and no, I have not installed Git. Can’t you copy the Gist to your GitHub?
Also, I thought Git was for your local projects, with CodePen being internet based, how is that going to work? I feel like I am missing something.
I’m not on my computer so I can’t check, but I think no.
Your first step is to download Git for Windows.
ok…i will do that now
Git is for version controlling your local projects. You don’t have to use it right away, but the sooner you use it the better imo.
GitHub is completely unrelated to codepen - they are not designed to work with each other. However, many of us port our early codepen projects to GitHub to make use of GitHub Pages and to back up our work.
If we ignore GitHub pages for a sec, which is a touch more complicated, what I would do is this:
- Export the codepen project and save it in a folder on my computer.
- Set up an empty repo on GitHub, note the URL for cloning/setting a remote
- At the command line (git bash / Powershell on Windows) navigate to the folder I made.
git initin the folder from the command line
git remote add origin <URL-of-my-repo>at command line.
git add .
git commit -m 'initial commit'
git push origin master
You’ll need to do some config on your first usage, but Git should walk you through that IIRC.
Thanks. I will do that. Much appreciated.
I noticed you are really still quite new to FCC, so don’t stress too much about GitHub yet if it gets too tricky. Focus on building projects first; GitHub will be there when you really need it
Thanks. I thought we were supposed to be backing up our projects while going through them. Thanks for the encouragement.