A Parody on git and GitHub
This is an introduction to GitHub and Git aimed towards beginners and professionals alike. Anyone who wishes to see Snape open sorcerer-ing his special edition spell and curses book is welcome to read this.
Severus Snape is a fictional character from the Harry Potter Books
In this alternative timeline, somehow Snape survived. He then realizes that he ought to get famous now. He is done protecting Harry since Voldemort kissed everyone goodbye for the last time. He is finally done with all the Lily's eyes thingy.
He being the most gifted wizard of his time decides to open source his new book:
Advanced Potion Making Vol-2 - by Severus Snape
One reason also being that he wanted to save this new book from any life threatening event. He painfully recalls his original book.
Muggle is a made up word from the Harry Potter books which refers to people who are not from the world of magic.
Snape decides to use muggle tech for this. For some reason he started a liking in muggle-tech. He went on to GitHub although most probably it didn't exist in his time but whatever, maybe he lived very long.
Legend has it that every time Snape took of 10 points from Gryffindor his upper life span increased by 1 year
So Snape, in his new Slytherin themed PC, goes on
GitHub and creates a new repository (basically a place to store code and documentation).
What do you think Snape's GitHub username would be? Comment down your thoughts on this. Would appreciate fellow Potterhead's.
So he creates this new repository named
In order to follow along, go though the following steps:
- Visit GitHub and create an account.
- Click on the
+icon at the top-right corner - >
- Name it appropriately - >
Snape now has a safe place to store his book on the internet
(a muggle technology that connects people from all over the world). He pushes the contents of his book inside this repository. He does this using a tool known as
Basically git is a software that helps you store your code/documentation safely on a storage space such as GitHub as well as helps you (in collaboration with GitHub) to work with different people from around the world.
After a few months, his book had over a million readers. He decides to go on a vacation to celebrate.
He's now in Hawaii having the time of his life. He forgot that his Slytherin themed PC is back in home. He is now receiving emails from people all over the world asking for the Code for his various spells.
Pressurized by his new fame he buys a new laptop and is able to get his book back thanks to
git. He does this in the following way:
- He logs into his
GitHubaccount and navigates inside his repository:
- He clones it. Cloning literally means the way it sounds. Getting a copy of the code/documentation.
He does that by clicking on the
Codebutton and then copies the
HTTPSlink in order to be able to get the book locally on his new laptop.
- He opens a new folder on his PC and initializes it.
- Next he clones it and creates a separate branch in order to work on his codes.
- And then goes onto add files such as
Sectum-Sempra.cppetc. The commands followed respectively are listed below:
git clone https://github.com/Always/Half-Blood-Prince.git
git checkout -b Spell-Codes
git add Sectum-Sempra.cpp
git commit -m "Added my favorite spell"
git push origin Spell-Codes
git init initializes/prepares the folder/space for you to put your stuff in it.
git checkout -b Spell-Codes actually does two things. It creates a new branch
-b flag) and checks out into it. Creation of a separate branch helps us work on the code/documentation without affecting the original content directly. This is a safe way of working so that you can safely build and test your new stuff before pushing it into the main repository.
git commit -m "Added my favorite spell" helps Snape remember what he did and when he did it. The
-m flag enables us to write the message in the command itself.
Now Snape visits his repository on GitHub and opens a pull request. He examines the changes properly and merges it into the
master branch i.e. he safely clubs the new changes with the original.
Snape's life is going well now since he is making loads of money from his sponsors. He regularly pushes stuff now. He is getting ambitious. Let's see how life goes for him in the coming posts (maybe..).
You might want to go through a few resources posted below in order to understand more about git and GitHub:
If you found this post useful and fun to read, then consider leaving a like and comment down your theories. Also, feel free to suggest any changes or further topics you'd like to be written.