How to use github for beginners

Published: 7/14/2025

Last week, we talked about Git. As promised, this week we will talk about GitHub.

In particular, we will talk about

  • The relationship between Git and GitHub.
  • The step-by-step process to get your code live on GitHub

Git is local. Meaning, your project’s git commits are only available on your local computer. But how do you show off your great projects to other people?

The easiest way is to create a compressed zip file and send it to others.

Nothing wrong with that, but we have a more handy tool, called GitHub.

GitHub is basically a cloud storage for your Git repositories. It’s a platform where you upload your git repository to share and collaborate with other people.

The git repo on your computer is called a local repo.

To upload your local repo, you need to create a remote repo on GitHub.

This is how to do it: Go to their website, click the create new repository button. Then fill in this form and submit it:

github create repo page

If you visit the page, you will see something like this:

"https://github.com/animecoders/project1.git". Your code doesn’t exist yet, because obviously you haven’t uploaded it.

The exact steps to upload your code are specified on this page. You can use GitHub Desktop, which provides a GUI to run git commands without using the terminal.

But if you want to be the cool kid, you have to learn how to do it through the terminal.

There are two steps.

The first one is to link your local repo with GitHub. Go to the location of your local repo and run “git remote add origin”.

Origin is the location of your remote repository. You are specifying where you want to upload your code. Here we are setting the origin to: "https://github.com/animecoders/project1.git"

The second step is git push.

The exact command looks like this: “git push -u origin master.”

It uploads your code to the remote GitHub repo, and the branch name is “master.” “-u” flag is used so that in the future, you can simplify the command to git push.

But nowadays, most people like to call the master branch main. But by default, the default branch name Git uses is still master. So people usually rename it with “git branch -M main” before git push, and do “git push -u origin main.”

Now, if people visit "https://github.com/animecoders/project1.git" they will be able to see the code.

The cheat code to become a programming master

Easy-to-digest tips and tutorials that help you get ahead of other developers.