Some time ago, Linus Torvalds sat thinking to himself, pondering various ways to make me smile and a little happier than I already am (That's, regarding other countless projects he has done already, and I'm ecstatic about), he thought so hard then came up with the idea of Git.
Thank you, Linus Torvalds, I must say I am loving it.
So what is Git?
Well according to legend, it is said that Linus Torvalds wanted to have a Source Control Management system, designed to keep track of any project, documenting the entire lifecycle, from conception to deployment. Since it is believed that once a project (or software) has commenced, its immortality just began. I project never really dies but evolves. It goes through stages of transfigurations and metamorphosis. Several ideas spawn out of unexpected outcomes that occasionally forces a fork to alternative project timelines, concurrently running in parallel to the initial conception of the project. Hence several versions are born.
The project gets more than it bargained for due to the evolutionary process it had or currently undergoing.
Therefore, despite the fact that Linus (the creator) set out to make me a little happier, Git was born.
Git provides the platform that could document and store all source code or project. If you deem an idea you pushed into production, you could literally rollback or return to a previous version that you know it was working.
Why am I so fussed about Git?
Well thank you, that's a very good question. As an IT enthusiast, my learning days are never over. I find myself back in the classroom, or on an IT course starting or recreating a new project.
Since (no prizes for guessing correctly but) all my machines or platform are primarily Linux based, I do have to traverse the life cycle of my project most definitely through the Terminal OR Command Line Interface (CLI) if you prefer, then use a syntax of commands in accordance to whatever the task may be.
Occasionally, some of these commands aren't the ones I execute on a day to day basis, I may not be used recalling them on the fly. I'd admit I do struggle to recall a syntax or command I used about 2-3 years back when I attempted and successfully installed my FreePBX box (Its an internal VIOP telephony system I set up at my home, for reasons I still cannot remember, nor for a use, I fail to fathom. However do recall the thrill of setting it up, the fun I had troubleshooting the issues that arose, and it felt good using it when I was done.) Now those commands, are transferable skills to future projects if I could conveniently recollect them ..
So if all projects are safely backed up to Github, its a matter of retracing my steps.
Git cannot not just be utelised by programmers and project managers alone, Undergraduate students could benefit alot from git partronage.
Back In Uni, my undergraduate days, as a student, like the others I had suffered several mishaps. They had been times that a computer crashed while, a 200 page academic coursework was being typed. I also remembered that I had no form of external drive for backup. Other misfortunes suffered by students had been known that everything saved and sole copy of all work done, was on a single USB stick, and that stick got lost.
If I knew, the pleasure of Git then as I do now, I would have been over the moon while explaining the importance of pushing a commit after each change or modification you do to a file/folder. A cool function of git is that its saves the entire folder as a single project in a git repository.
and on each change/modification, git records the transactions individually in its logs, therefore providing a track-line of the evolutionary process.
The list of the praises I could give git is endless, but one allegory I could use to highlight another importance of git is, a person reference of mine.
I do confer with my Dad a lot on various issues (He's a Mechanical Engineer by profession), All my life, we've bonded on occasions he explains the intrinsic of a Vehicular engineer, as a can-do or Mr-Fix-it guy myself, I would delve into broken down, Petrol or Diesel engines, and yes I do get it fixed. But times I stop and ponder, my Dad steps in and shows off his vast knowledge in the mechanical field, I listen, absorb it as a tutelage, on his advise, I get the Job done.
I dont get to fix broken down vehicles, at the same frequency as I used to, but Linux and IT has in a subtle way stirred my destiny towards a path far from any hydro-carbon combustable device, but I still have moments where we try to bond over a project I am working and deem it soo cool to inform of every intricsic detail about it.
He is very much interested in all my projects, (believe it or, not my Dad loves IT and Gadgets. Just dont ask him to trouble any should they get faulty.) but in his interest and inquisitive nature, He is always fond of providing alternative suggestions. Why don you try it this way? How about you make it do this instead ? He says .. In turn, forcing me to either abondon my project or just do as he seemed to please him .
Now, thats where the power of Git comes again. The moment my Dad, says "how about you try this way?" seeking an alternative outcome, in git, I could just invoke a Git branch .. A Git branch per sa, is not a new project, but just a pivoting moment that can accommodate any alternative course, or ending.
With a Git branch, I could continue how ever I was inspired to lead my project, and at the same time take the suggestion of my Dad for a pivot on its direction.
The other cool, feature is, should my Dad and I actually come to an agreement that both our ideas are valid, we could eventually merge both branches back to a single timeline.
Takin my short illustration into account, imaging the countless implication of git to quite a number of real life instances in varios professions.
For instance, many fans of Harry Porter had suggested that Harry had fallen in love with someone else, some several books back. Or we could have versions of Game of Thrones, where not all the Dire-Wolves of house Stark were killed off, and not every loved character killed. Don't get me started with Fast and Furious, but we are waiting for the version of the movie will be shot in space. Elon Musk just has to speed up his SpaceX programs to facilitate that version.
Git Cheat Sheet ..
Ok, I have sung the praises of Git, I guess its now I would reveal some of the Cheat Sheet, to my basic
understanding ..
If you would love to have a practical understanding about Git, so you type, save, add, commit and push as you go, I would suggest you visit www.codeacedemy.com you can get lots of practical experience on many courses, (Python, Ruby, Java, Git, Unix, etc, take your pick ... ) but there You can get a little Git practical experience.
Then Love Git, as I do .. LOL.
Below is a table of my Git Cheatsheet, I created on an occasion I took a Git practical course on www.codeaccedemy.com .
Git Command |
What it does |
|
git init | creates a new Git repository | |
git status | inspects the contents of the working directory and staging area | |
git add <file name or . or * > | adds files from the working directory to the staging area | |
git diff <file name> | shows the difference between the working directory and the staging area | |
git commit -m " Your message goes here .." | permanently stores file changes from the staging area in the repository | |
git log | shows a list of all previous commits | |
|
||
git show HEAD | ||
git checkout HEAD <filename> | git checkout HEAD <filename> | |
git reset HEAD <filename> | Unstages file changes in the staging area. | |
git reset <commit_SHA> | Resets to a previous commit in your commit history. | |
git branch | Lists all project's branches. | |
git branch <branch_name> | Creates a new branch. | |
git checkout <branch_name> | to switch from one branch to another. | |
git merge <branch_name> | to join file changes from one branch to another. | |
git branch -d <branch_name> | Deletes the branch specified. | |
git clone <remote_location> <clone_name> | Creates a local copy of a remote repository | |
git remote -v | Lists a Git project's remotes. | |
git fetch | Fetches work from the remote into the local copy | |
git pull | Fetches work from the remote and overwrite the local copy | |
git merge origin/master | Merges origin/master into your local branch. | |
git push origin <branch_name> | Pushes a local branch to the origin remote. |
There's a whole lot more git commands, that I could recall and mention here, but many of which I would have to plagiarise a number of online articles and pawn them off as my own (LOL).
I might as well just provide the links to such articles for your benefit, then you could review them your self.
However, the ones I have eloquently provided in the table above is somewhat sufficient for anyone who wishes to give Git a go.
- This link is actually a Git repository of someone's Project on Github.com, Author pretty much did exactly what I did but I must say, he pretty much went a whole lot further than I did. So, in the future when I decide to call on some advance git commands, I would be glad if this repository is still up for my convenience. << Just click here, to review his Cheat Sheet. >>
- This other article I found on the net, is actually an online tutorial, of practically everything about Git. From installing Git as a beginner to Collaborating with other Project team members, like a professional. It is well written and much more appreciated than my article. << Just click here to review the online tutorial >>
- This last link is actually a two page PDF document, that just highlights some of the essential commands, necessary to have a git project up and running. << Click here, for the PDF document >>