Git Basic Workflow
Objective
Learn a basic workflow for social coding with git.
Storytime
Once upon a time in the enchanted land of Vitrua, there lived a wizard named Wizzle. Wizzle was not your ordinary wizard; he was part of an order of fellow wizards and sorcerers who shared all their spells through a big cauldron. One day, Wizzle got an idea to upgrade the Fire spell, and he extracted a magical paper named fire.spell from the cauldron.
Inscribed on the paper was the spell to conjure flames - a simple yet powerful "Fire" spell. Wizzle was excited to make it even more powerful.
The Spellcasting Ritual:
-
Create a New Branch - Fireball:
- Wizzle opened his enchanted terminal and invoked the Git spell to create a new branch named "ball":
- With a flick of his wand, he switched to the "fireball" branch:
-
Update the Spell - Fireball:
- Wizzle opened the magical
fire.spellpaper using his text-editor visualization spell. - He modified the incantation from
FiretoFireball, bringing the new spell to life. - Wizzle added the updated spell to the magical Git cauldron.
- With a wave of his hand, he committed the changes, letting the other wizards know what you can do with the new spell:
- Wizzle opened the magical
-
Merge the Fireball Magic:
- Satisfied with the powerful Fireball spell, Wizzle decided to merge it into the main spellbook. He switched back to the main branch:
- He merged the Fireball magic into the main spellbook:
The Grand Finale:
With a sense of accomplishment, Wizzle pushed the updated main spellbook to the magical cauldron:
His fellow wizards and sorcerers, connected through the magical network, marveled at the newfound powers of the Fireball spell.And so, in the land of Vitrua, Wizzle the Spellcaster continued to weave his magical Git commands, creating powerful spells and enchantments for the entire magical community.
Magical Git Commands Summary:
git branch <branch_name>: Create a new branch.git checkout <branch_name>: Switch to a branch.sed -i 's/Fire/Fireball/' fire.spell: Update spell text.git add fire.spell: Add changes to the staging area.git commit -m "Commit message": Commit changes.git merge <branch_name>: Merge changes from another branch.git push origin <branch_name>: Push changes to a remote repository.
And so, the tale of Wizzle the Git Spellcaster goes down in the magical scrolls of Vitrua, inspiring wizards and developers alike to wield the power of Git for enchanting collaborative creations.