Understanding Git and GitHub
Giwa Jossy
Posted on July 28, 2020
First of all, Git is to GitHub – what porn is to pornhub.
Let me tell you a story.
Back when i started out coding, and had to collaborate with another developer, i would send the backend guy a zipped version of my frontend code – either in a flash drive, or via email, and whenever i needed to make further UI changes, he would send back the codebase [including his backend code], and I would have to navigate the codebase to make my changes without messing up my guy’s backend code.
So Rookie! But hey! We got the job done. Most importantly, I had fun doing it.
Imagine the horror if it was a large project – with over 15 developers working on it.
By the way, I started out doing web design – using HTML, CSS, and jQuery because it was the only coding space I felt I could immediately see the effect of my code.
For some reason, the resources I could lay my hands on – made zero reference to Git or GitHub, so I had no idea what those terms meant. Even after I finally got to know of them, the concepts got more and more confusing than I’d like to admit.
Now that I understand the concepts, it has been a fun ride.
Git and GitHub are two very different entities, and can not be used interchangeably.
Git is a distributed version control system; this means It allows us to track changes in an application, in a folder, in a single file – over time, across different users, and different computers.
GitHub is like a social network or platform for Git repositories; a repository is a set of files for a project. GitHub allows us to share our repositories with team members, publish things online, and collaborate on open-source projects.
Git can be used on it’s own. It is the main technology, while GitHub is the platform to share it and collaborate using Git.
The first step to becoming a Git-GitHub rockstar is to try out this simple task;
Let’s create a simple repository containing a readme.txt file
- Download Git here
- Register on GitHub, and create a repository.
- Now create a “readme.txt” file in a folder on your desktop.
- Open this folder > Right click > Now click the “Git Bash Here” option to open the terminal.
- In the terminal, type
git init
then press enter git add readme.txt
git commit -m "first commit message"
-
git remote add origin URL
[copy this URL from the your repository page] git push -u origin master
We have successfully created our first repository containing a readme.txt file.
This can be shared with team members so they can make changes within the file, or even create new folders which would be accessible to you.
Posted on July 28, 2020
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.