Essential Git Commands Every Beginner Must Know

Muhammad Abdullah
Software Engineer & Tech Enthusiast

The First Steps Into Git

When I started learning Git, I felt like I was staring at a foreign language. Commands like commit, pull, push, and status flew over my head. The documentation was long and robotic. I wished someone would just hand me a cheat sheet and explain it like a human. That’s what this chapter is for: the Git commands you will use every day, explained in plain English.

Setting Up Git (One-Time Setup)

# Configure your name (appears in commits)
git config --global user.name "Your Name"

# Configure your email
git config --global user.email "you@example.com"

# Check your configuration
git config --list

Everyday Workflow Commands

Here are the bread-and-butter commands you’ll use in almost every project:

# See what’s going on in your repo
git status

# Add all changes to staging area
git add .

# Save a snapshot of your work
git commit -m "Describe your change"

# Push your changes to GitHub
git push origin main

# Get the latest changes from GitHub
git pull origin main

Branching Basics

Branches let you experiment without breaking the main project.

# Create a new branch
git checkout -b feature/login

# Switch back to main
git checkout main

# Merge your branch into main
git merge feature/login

Checking History

Sometimes you just need to know what happened in the past:

# See commit history in short form
git log --oneline

# See changes made to files
git diff

Benefits of Mastering These Commands

Pro Tips From Experience

The Reality Check

You don’t need to know every obscure Git command to get started. Mastering these basics will cover almost everything you do daily. Over time, you’ll naturally pick up advanced features like stash, rebase, or cherry-pick. But if you’re just starting, focus on these essentials. They’ll take you from Git beginner to Git confident.

Think of this as your Git survival kit—carry it with you, and you’ll never feel lost again.