Git is a version control system that keeps track of your code and all the changes made to it. It’s designed to keep history and keep all files and projects stored in a repository. A repository is a container that holds a collection of files. In the professional world, developers use control systems like Git to be able to share code with other co-workers and make changes that can be tracked and rolled back to. Github is a hosting platform specifically for Git repositories.
So we can create a directory/ folder on our computer and we would clone a repository from Github to be able to push and pull changes between the master repository and our local directory on our machine. We access Git through the command line and there is plenty of new syntax to know when using it.

With this example I created a repository on Github and I will connect it to my local machine using the Mac terminal app.
First we have to change our directory to the folder we want to use on our machine using ‘cd’ – “change directory”. Once there we can clone the repository.
To clone we use “git clone” and then we use the url provided by Github.

Once we have that cloned in, we want to move into that new directory so we can manipulate some things there.
So Web Developers will have different files like images, html files, or javascript files. We want to remember that when handling these files on our Git repository we need to follow this pattern.
Add – Commit – Push – Pull
So when we want to add a file we would use the add command

Let’s add a text file to our repository. After using the add command we have to commit our change to the repository and then push it on to Github.



Now let’s check if it worked on Github.

This is the basics of using Git/Github and more info can be found here.