Day-10:Advance Git & GitHub for DevOps Engineers

day-10 of 90 days of DevOps Challenge

Day-10:Advance Git & GitHub for DevOps Engineers

Introduction🎉

Hello there, fellow tech enthusiasts! Welcome to the enchanting world of Git, a magical version control system that will empower you on your journey as a budding IT professional. Today, I'm here to demystify some essential concepts in Git, and trust me, by the end of this blog, you'll be wielding your version control wand like a seasoned pro!

Concepts💭

Git Branching - Unleashing Your Creative Magic!

Imagine you're a wizard crafting a magnificent spellbook. Git branching allows you to work on multiple spellbooks at once! Each branch is like a parallel universe where you can experiment and add new features without affecting the original spellbook (the master branch).

Command to create a new branch:

git branch <branch_name>

Git Reset - Rewind Time and Space!

Who hasn't wished for a time-turner like Hermione Granger? Well, Git reset can't send you back in time, but it lets you rewind changes within a branch. It's like using an eraser to remove unwanted spells from your spellbook.

Command to reset to a specific commit:

git reset <commit_hash>

Git Revert - The Art of Undoing Magic!

Even the best wizards make mistakes! Git revert is like an "undo" spell, undoing the effect of a specific commit. It doesn't erase the mistake but rather creates a new commit that counteracts the undesired magic.

Command to revert a commit:

git revert <commit_hash>

Pull Request Merge - Gathering Magic from All Over!

Imagine you've perfected a new spell in your branch, and you want to bring it back to the main spellbook (the master branch). Submitting a pull request is like sending a magical invitation to the grand wizard (repository maintainer) to review and merge your changes.

Command to create a pull request:

git pull-request

Branches Merge - Blending Magic Harmoniously!

Remember those parallel universes we mentioned earlier? Merging is like bringing together the best elements from multiple universes into one cohesive spellbook. It combines the changes from one branch into another.

Command to merge a branch into the current branch:

git merge <branch_name>

Merge vs. Rebase - Harmony vs. Magic Rewrite!

Picture two schools of magical thought. Merge creates a new merge commit, while rebase rewrites the spellbook's history, making it appear as if the changes happened sequentially. Choose wisely, young wizard, as each has its benefits.

Command to rebase your current branch onto another branch:

git rebase <branch_name>

Task-1:

Solution:

Part-01

Part-02

Part-03

Task-02:

Solution:

Conclusion🎇

Congratulations, aspiring Git wizards! 🎉 You've reached the end of this mystical journey through the enchanting world of Git. You now hold the keys to Git branching, resetting, reverting, merging, and more! Embrace the magic of version control as you craft your software spells with finesse and precision.

Remember, becoming a Git master doesn't happen overnight. Embrace mistakes as learning opportunities and don't be afraid to experiment with different spells in your branches. As you gain experience, you'll weave more intricate and powerful software magic🧙‍♂️✨