My Blogs

From Zero to Git Hero

Using Git from Beginner to Advanced

A slow, detailed, beginner-friendly guide to Git — explained patiently, step by step.

If you’ve ever ended up with filenames like final_v3_REAL_FINAL.zip, or hesitated to edit a file because you were afraid of breaking something, Git is exactly the tool you need.

Git helps you track changes, experiment safely, collaborate confidently, and undo mistakes without fear.

What Is Git, Really?

Git is a version control system. It records how your files change over time, allowing you to save checkpoints, compare versions, and recover previous states.

Git works locally on your computer, while platforms like GitHub simply host repositories online.

Installing and Configuring Git

Check if Git is installed:

git --version

Configure your identity (done once):


git config --global user.name "Your Name"
git config --global user.email "youremail@example.com"
      

Creating Your First Repository

A repository is simply a folder that Git tracks.

git init

Git creates a hidden .git directory where all history is stored.

The Git Workflow

Edit → Stage → Commit

Making Your First Commit


git status
git add .
git commit -m "Add initial README"
      

A commit is a snapshot of your project at a specific moment in time.

Branches and Merging


git checkout -b feature-login
git checkout main
git merge feature-login
      

Branches allow safe experimentation without affecting stable code.

Working with GitHub


git remote add origin https://github.com/username/repo.git
git push origin main
git pull origin main
      

Undoing Mistakes


git checkout -- file.txt
git reset file.txt
git commit --amend
      

Final Thoughts

Git is a skill you grow into. Everyone struggles at first. With practice, Git becomes a powerful safety net.

Happy committing 🚀