Using GitHub with FCC

There’s supposed to be a way to upload our FCC lessons onto GitHub with Sublime Text. I haven’t figured out just yet how it’s done. If anyone knows…I’m using a Mac.

There’s no special link between freeCodeCamp and GitHub (i.e. nothing automatic for uploading code).

To save your code on GitHub you’d need to save it on your local computer and then sync it with Github.

Have you used git and github before?

No, I’m just learning how to use it now. I’ve opened a few repositories as an exercise in learning how it works. I forked one of their contributions repositories but I’ve been having trouble trying to understand how to do a pull request. I’ve started something with the open-pixel-art contributions for learning how to do that but I’m only half-way there…trying to figure it out.

Cool, I’ll assume your working from scratch then. This is all done in the terminal, btw.

Create a folder, called fcc, for example.

You can do this with your terminal by typing

mkdir fcc

Then move to the folder with:

cd fcc

Now initialise git for that folder:

git init

Go to github.com/new and create a repo with the same name as the folder, fcc. Don’t add a readme or anything, that’ll just complicate matters for now.

Copy the clone url from your blank repo. It will look something like https://github.com/Bergi5/fcc.git

Now go back to the terminal and add your remote origin:

git add remote origin https://github.com/Bergi5/fcc.git

Obviously, use the clone url you copied.

Now write some code and save it to that folder.

When you have changed you want to save to GitHub:

git add .
git commit -m 'descriptive commit message'
git push origin master

That will push everything up to your github repo.

This is fantastic! Thank you. I suppose I could do the same using Sublime Text?
I’ll be giving your instructions a closer look tomorrow as it is getting late, and I’ve been working here for several hours this evening all ready. Thanks again!

A lot of modern text editors usually have a button to make commiting and pushing a little quicker, but I’ve never used sublime so I couldn’t say for sure.

Okay. Thanks. I’ll look into it further and let you know when I figure that one out.

1 Like