Skip to main content

Command Palette

Search for a command to run...

Introduction to Git And Github

Creating your first repository and commit

Published
3 min read

I started learning about Git and Github few weeks ago so I looked forward to sharing what I learnt so far. As a newbie in programming I initially could not connect to these terms and would really ponder how they differ. My Understanding of Git and Github did not start to become clearer until I understood what version control (VC) was. Version control is a system that keeps track of changes made to a file or set of files over time so that you can later recall particular versions. So for example in an index.html file

<h1>Hello world</h1>

And for some reason you added to it

<h1>Hello world</h1>
<p>My name is Seun</p>

The new file now becomes the second version of the index.html file. Imagine as you keep writing you made a mistake and can not figure out how to fix it. As a programmer, this will often happen because our codes are interlinked to each other. In moments like this you really want go back to a previous version and this is where tools like Git and Github come in, although other tools can be used too but Git and Github are really popular.

What is Git?

Git is a free and version control system designed to keep track of your projects from very small to large projects and it is fast and reliable. It runs locally on our system, remember our files are stored on the computer. Git helps store them and keep there history. It is more like a central hub where we can upload and keep track of our changes. It also enables to collaboration among developers all over the world as it gives access to download and automatically merge changes, that means different developers can work on the same file of project and eventually merge those changes without losing each other work just because we always roll back to previous work!

What is Github?

This an online database or repository that allows you to keep track, manage and share your Git version control projects outside of your local computer/server. When projects are placed on Github it gives a wider access to users all over the world unlike when they are just locally on our computer. So yes, Github gives more functionality and resources as well online storage.

So what exactly is difference between Git and Github?

Git is a version control system that lets you manage and keep track of your source code history. It is accessed via the command line. GitHub is a cloud-based hosting service that lets you manage Git repositories( container of all projects and files). It can not work without the internet.

How to get started with GitHub ?

  • First Sign up for a Github account and this absolutely free!

  • Now create a new repository.

  • In the upper-right corner of your page , use the drop-down menu, and select Create repository

Screenshot (5).png

  • Type in the name of what you like to name your repository.

Screenshot (6).png

  • Choose what visibility you want. You either make private or public repository.

  • This is not compulsory you may like to add a description of your repository. For example, My First Repository

  • Select Initialize this repository with a README file, this file gives more description about the project you are working on.

  1. Click create a repository! and there you have it your repository.

Screenshot (8).png

How to make your first commit?

Now that you have your repository you can insert your files or make changes to your files.

  • For instance you just make changes to your README file.

Screenshot (12).png

  • You will have to commit your changes.

Screenshot (13).png

  • The commit records changes to one or more files in your branch by clicking on commit changes.

Screenshot (14).png

I hope you enjoyed reading this! Have a nice day.

P

Well written bro. Fix: *we can always rollback to our previous work.