What you need to learn when starting with Git and GitHub

To make things much less confusing as a beginner.

Shanen Audrey Perez
4 min readNov 4, 2021

First, you need to know that Git and GitHub are two different things.

Git is a free open source version control system where you can track your changes in a program or documents or large collections of information which is extremely helpful for big projects.

On the other hand, GitHub is the online platform where you host your Git projects. This where the changes of your programming files appear.

Getting Started

Before diving into git commands and exploring GitHub, we have to set up a few things first. You can skip this step if you already have everything ready.

  1. Go to https://www.github.com/ and sign up or log in if you already have an account.
  2. Install Visual Studio Code or use any code editors of your preference. You can download Visual Studio code through this link: https://www.code.visualstudio.com/Download
  3. Use GitHub Desktop: https://www.github.desktop.com
  4. Download Git Bash: Git — Downloads (git-scm.com)
    To set up Git on your computer, follow the instructions here: https://www.atlassian.com/git/tutorials/install-git#mac-os-x

Terms to keep in mind

In many tutorials, there are terms that will be constantly mentioned that you need to be aware of.

  • Directory is the folder where you are currently in.
  • Terminal is where you will input commands.
  • Repository is where your project is kept. It is seen in the GitHub site.
  • cd is a command short for change directory that you put in the terminal to change the current folder you are in.
  • README file is where you put the longer description of your project.
  • Branch is in the GitHub site when you open your repository file.

Basic Git Commands

When typing commands in the Visual Studio Code terminal or in Git Bash, the letters should all be in lowercase.

  • clone command saves the repository you created in GitHub to your computer.
  • if you copied SSH and ran into an error like permission denied, open Git Bash and generate an SSH key pair then add the public key in your GitHub Settings > SSH and GPG keys. You can follow this tutorial to fix that issue: How to Fix “Permission denied” Error From Github — YouTube
  • status command shows all of the files updated, created or deleted but haven’t been saved in Git yet.
  • add command tracks your files and changes in git.
  • Use “.” to track all the files and changes or you can just specify the file like in the example below:
  • commit command saves your files in Git.
  • -m stands for message where you add your message in the double quotations.
  • push command uploads your Git commits from your computer to a repository in GitHub.
  • Go to GitHub and open your repository then look for the branch name, below is named “main”.
  • If you’re going to run the push command using the “main” branch name, it will look like:
  • pull command downloads the changes from GitHub to your local computer.

For an in-depth explanation on how to use these commands, I recommend that you try out FreeCodeCamp tutorial in YouTube:

Git and GitHub for Beginners — Crash Course — YouTube

Check out Git’s documentation for reference:

Git — Reference (git-scm.com)

Thanks for stopping by and reading this article!

If you have questions, you can comment down below! :D

Happy Learning! 😄

--

--