Latest news about Bitcoin and all cryptocurrencies. Your daily crypto news habit.
Youâve probably heard of GitHub as youâve explored the expansive programming world. People keep saying that you need to use it because tons of people use it and your future employers will like to know that you use it. And so youâre thinking about using it but you donât even know what it is. Or perhaps you do know what it is and canât quite explain it. Then thereâs this Git thing that sounds similar to GitHub. Theyâre two completely different entities.
Weâre going to help you by explaining what Git and GitHub is to a eight year old.
Git
Imagine youâre eight.
You love playing with Legos. Youâve built castles and forts and ships out of Legos. But youâve always had to take your Legos apart because your mom always tells you she doesnât have space in the living room to keep your toys.
Then one day, your mom bought a shelf to save your toys. So now you can keep whatever you save. She even gave you stickers to give names to your Lego projects. That is Git, my friend. You get to save your own projects in your own hard drive and write comments about your code.
git add allows you to add Legos to your shelf
git commit allows you to save your Legos. Itâs like telling your brother or sister not to touch your Legos.
Github
Now, say your mom buys you a giant Lego set for your birthday that allows you to build New York City. That might take years for you to build if you work on your own. So you tell your mom that you want your friends to help you build it. Your mom doesnât want you guys making a mess so you decide to build the Lego set in the park. Thatâs the âHubâ part of GitHub. You can take your code or your Legos to Github and share it with everyone.
git remote add origin https://github.com/YOUR-USERNAME/legos
Those who want to use your code will fork your code. That just means theyâll copy the code so that they can work on it on their own. Itâs almost like someone borrowing your Legos so that they can build something on their own. ExceptâŠyou donât have to lose any of your own Legos. They get to clone your Legos.
git clone https://github.com/YOUR-USERNAME/legos
Isnât that cool? Now your friends can work on what youâre working on. So one friend can focus on building apartment buildings and another friend can focus on office buildings. When your friends bring all the pieces together, you will have a completed Lego set. Thatâs whatâs called pushing code.
git push origin master
You will pull up the pieces after theyâve pushed them to you. Either you or they will submit a pull request, which is like your friends asking if you like how they built their Legos. If you like it, youâll accept the pull request. If you want them to fix it, youâll reject the pull request.
Conclusion
Thatâs GitHub in a nutshell. The process of pushing and pulling code is called version control. Every step of the way, coders ensure that their version is the latest version. Sometimes, if you mess up the code, you can even go back to earlier versions of the code to erase the mistake. In this way, thereâs rarely a âDog Ate My Homeworkâ situation when youâre using a version control system like GithHub.
Of course, you always have to make sure to commit and document changes so that you can take full advantage of GitHub. There is so much more you can learn about GitHub beyond this very basic understanding. Weâve left resources here that will help you gain a deeper understanding of Git.
Resources
GitHubâs Tutorial On How To Use GitHub:
https://guides.github.com/activities/hello-world/
Git and Github Video Tutorial:
https://www.youtube.com/watch?time_continue=211&v=SWYqp7iY_Tc
Hubspot Guide For Beginners(Installation Help):
https://product.hubspot.com/blog/git-and-github-tutorial-for-beginners
Explaining Git and GitHub To an Eight Year Old was originally published in Hacker Noon on Medium, where people are continuing the conversation by highlighting and responding to this story.
Disclaimer
The views and opinions expressed in this article are solely those of the authors and do not reflect the views of Bitcoin Insider. Every investment and trading move involves risk - this is especially true for cryptocurrencies given their volatility. We strongly advise our readers to conduct their own research when making a decision.