GitHub uploading

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. :frowning:

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.

So are you creating a new repository, then copy/paste the code from the HTML/CSS/JAVASCRIPT to new files???

If we ignore GitHub pages for a sec, which is a touch more complicated, what I would do is this:

  1. Export the codepen project and save it in a folder on my computer.
  2. Set up an empty repo on GitHub, note the URL for cloning/setting a remote
  3. At the command line (git bash / Powershell on Windows) navigate to the folder I made.
  4. Run git init in the folder from the command line
  5. Run git remote add origin <URL-of-my-repo> at command line.
  6. Run git add .
  7. Run git commit -m 'initial commit'
  8. Run git push origin master
  9. ???
  10. Profit

You’ll need to do some config on your first usage, but Git should walk you through that IIRC.

1 Like

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 :slight_smile:

:slight_smile: Thanks. I thought we were supposed to be backing up our projects while going through them. Thanks for the encouragement.