DEV Community

Cover image for The Difference Between
Mr.Noixe
Mr.Noixe

Posted on

The Difference Between

A member of my Discord server was confused about the difference between Git, Git Bash, and Git Hub. This was my explanation.

What is Git?

Git is software that enables version control. With each change to a file, even the slightest change can become a new version of the file you working on. You decide what changes will be tracked, but Git is what enables you to track those changes. In case you're asking yourself why it's important to track your changes allow me to walk you through a common use case.

Imagine you are working on a project that has many files. Let's say that while you working on this project you accidentally introduce a bug in your code. Of course, your first instinct is to try to locate the bug and fix it. However, let's say despite all your efforts to locate and fix the bug, you are unsuccessful. You can not find what is causing your application to malfunction. Now, let me ask you a question. How helpful would it be if you could go back in time to when the document was totally bug-less? That essentially is what Git enables you to do. Using Git you can track your changes and create different versions of your project. Versions that you can then navigate between using applications like Git Hub, we'll talk more about Git Hub a little later. Keep on reading.

What is Git Bash?

Git Bash is a terminal. Before there were graphic user interfaces (GUIs) there were terminals. A terminal is a software that is primarily used to navigate the folders and files of a computer. Terminals have other features to be utilized, but for right now think of it as a file explore. Imagine a file explorer without any images or visual layout that you can use to navigate. That's basically what using a terminal is like. Terminals come with commands that you can enter to run certain instructions to your computer. You can use a terminal to create files, navigate into folders, initiate downloads, and more. All from a simple text-only screen.

Here's an example of what a terminal can look like:

Alt Text

Git Bash terminal.

What is Git Hub

A folder that holds code is often referred to as a repository or a repo for short. Git Hub is a very popular platform that programming teams use to store and access repositories. With Git Hub, you can do what's called a git pull, which essentially is downloading and connecting a repo on Git Hub to your local machine. From there you can then begin to make edits to the files that are in that repo on your local machine. To save your files locally you can usually click file > then save, to store your changes on your local computer (or ctrl + s as a shortcut). Keep in mind a normal save like this only saves the changes to your local machine. How do you save the changes on Git Hub? To store the changes on Git there are a few commands that you need to run inside of your terminal. To save the changes to Git Hub you must run the Git commit command which commits the changes and creates a new repo version. After committing the changes, in order to add the repo version to Git Hub, you must then run the git push command in your terminal. This officially pushes(adds) the repo to Git Hub. Alternatively, you can use the Git Hub desktop version to complete the same task, but with an actual interface.

Explaining the Git in Git Hub

Along with each commit that is pushed to Git Hub comes a timestamp attached to it. In Git Hub you can easily navigate between the different versions of your repo according to the timestamps. Imagine that you committed and pushed separate file changes to Git Hub at 12:00 pm and at 3:45 pm today. For each commit, there will be a repo version to go with it. One repo version for the commit and push made for 12:00 pm today, and the same for the commit and push made at 3:45 pm Today. You will then be able to navigate the history of the commits made to the repo and select which version you would like to view. This capability puts the git in Git Hub. Remember Git is all about version control and here we see that Git Hub enables us to simply travel between the many versions of a repo.

I hope you found this helpful, this was not meant to be a deep dive but a beginner introduction into the three topics. Let me know if you want to join my discord server, It's made just for beginning developers. I can send you an invite directly.

Thanks for stopping by,

Mr.Noixe

Follow Me On Instagram Here:Link

Follow Me On Twitter: Link @Mr.Noixe

More On Git: Link

More On Git Bash:Link

More On Git Hub: Link

Video On GUI: Link

More On Git Hub: https://techcrunch.com/2012/07/14/what-exactly-is-github-anyway/

Discussion (0)