"Code, Commit, Conquer: The Ultimate Git Tutorial for DevOps"

π§ Step 1: Setup Your Cyber Arsenal

Check installation:

π§βπ» Step 2: Set Git Identity
git config --global user.email "email@example.com

ποΈ Step 3: Initialize the Battlefield


π Step 4: Set Up SSH With GitHub
Now go to GitHub β Settings β SSH and GPG Keys and paste it like a pro.
Already done β (You rock). To confirm:

βοΈ Step 5: Connect to GitHub Repo
Create a new repo on GitHub β leave it empty (no README, no .gitignore).

Then connect:

To verify:

πΎ Step 6: Save and Upload Your Work (So You Donβt Lose It When Your Laptop Explodes)
git commit -m "My glorious Python scripts. Let the world admire."
git branch -M maingit branch -M main
git push -u origin maingit push -u origin main



πΏ Step 7: Work on a Separate Branch (So You Donβt Break the Main One)

List all branch

π Step 8: Push Your Changes (Hopefully After They Work)

Added some text and files

Tells you whatβs changed, because guessing is not a best practice.


Stages, commits, and pushes your changes. This is your βHey GitHub, look what I made!β moment.

Commits (saves) the changes with a message. Make it useful, or your future self will regret it.

Renames the default branch to main (modern times, people), and pushes it to GitHub.

π Step 9: Merge Branches (Without Causing a Code Meltdown)

Merges your work from sprint1 into main. Be sure to test first, or your teammates might hunt you down.

Now we are pushing to the main branch


Git status

π°οΈ Step 10: See What Happened (Because Memory is Overrated)

π― Step 11: Clone or Update Code (Because Copy-Paste Only Works Locally)
Makes a full copy of the repo on your machine. The legal way to βstealβ code.
π Pulling Updates

π οΈ Step 12: Fix Mistakes (Because Mistakes Will Happen)
Undo local changes: Restores the file to the last committed state. Like Ctrl+Z, but cooler.
Unstage a file: you accidentally added. Weβve all been there.
Undoes a bad commit safely by making a new one. Recommended for public repos.
Goes back in time and deletes history. Use only if you really mean it β no takebacks.
π Conclusion
Git is your time machine, project manager, and panic button β all in one.
Start small, commit often, and remember: git status is your best friend when things go weird.