Git

A simple way to keep things organised.

Card image cap

Git

Thursday 27th February 2018

So today I want to write about git and why you should probably learn it. Git like alot of the tools programmers make will simplify your life alot, its a tool designed to fix a very specific problem which is version control.

When you begin writing code your programmers are very small, a few lines at first, not more than 100, than you get better and build more complex and bigger programs, so your files also grow, at this point you maybe have 2/3 files, you are using imports and classes and its amazing, you can make code from one file work with code from a second file. Wow right? it was very wow for me.

but your programs keep getting bigger and now you have 10 - 20 files, with hundreds of lines of code each, you can't keep up so you try and get some help from a friend, he works on one file you work on the other at the end of the day you meet up, exchange the files, connect them again and boom it works. But than your friend changes something in your file and you change something in his, and you both want to keep the changes because they were so good, but you can't exchange the files directly because now there are 4 sets of different files, you have changes in your file that you just added and want to keep and there are changes in the copy of your file that your friend has, he added some changes to your file and you also want to keep those, so you guys decide to oberserve both files and copy and paste the lines you want to keep and delete the ones that are not needed, yeah this is going to be alot of work.

This is where git comes in, git is a platform that lets you and your friend work on the same code at the same time and it will "magically" work out which line to replace and which to keep and when it gets stuck it will ask you which to keep and which to delete in an easy and very simple, painless way.

Git lets large teams work together from all over the world, as of writting this I have only seen 2 of the developers I work with on a daily basis the other 4/5 are total strangers to me, I have never met them, all I know is thier usernames and profile pictures, tell me that is not amazing. We are in different time zones, different continents but we can work together on the same file.

Enough history, How do I use it?

First you will need a way to communicate with git, git is a tool and you need an interface, think of it as git is the internet, you need a way to view the internet like a browser, two of my favourite git access portals are
  • Github
  • Bitbucket
I started with github because it was free, and the most popular and very social, but later started using bitbucket because it offered private repos. OK