Today I ran a course on Git and GitHub with my teammates. I came up with this metaphor.
Let's say, you're going in vacations in the Caribbean and you want to be sure that you have all the clothes you might need.
You are going first to buy a suitcase that will fit all them and several packing cubes for better organization.
On your bed, you are going to lay all the clothes that you may want to use from your wardrobe. This is your local repository.
From that pile, you will select some clothes that you are sure to use. Let's say your favourite pair of socks
git add myfavouritesock.
Then you need to put those socks in a packing cube, in order to create a set that make logical organizational sense. You will add anything that make sense in that specific cube. Then, you are going to put the cube in your bag while you shout a description of it to your companion(s) for good measure.
git commit -m "Adding my new favourite pair of sock".
You repeat the operation a couple of time, with other packing cubes and you finally close your suitcase as you are ready to travel with it
Ok now the reality of my broken metaphor is that you don't move your suitcase to your island of destination (GitHub) but you put there a copy of it. As if the transporter of Star Trek would keep the original version.
All your clothes are now both in your suitcase at home and in an exact identical suitcase in your destination place, the GitHub island.
In the next episode, I will explain how one of your companion is going to retrieve your suitcase and change your clothes, because he is a funny person.