DEV Community

Kyle Y. Parsotan
Kyle Y. Parsotan

Posted on Edited on

Here’s a structured Git command guide from basic advanced, so you can grow step-by-step instead of memorizing random commands.

🟒 Beginner Git Commands (Must Know First)

These are the commands you’ll use every day.


βš™οΈ Setup (one-time)

git config --global user.name "Your Name"
git config --global user.email "you@example.com"
πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026 πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026

Check config:

git config --list
πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026 πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026

πŸ“ Start a project

Create new repo:

git init
πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026 πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026

Clone existing repo:

git clone https://github.com/user/repo.git
πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026 πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026

πŸ“Œ Basic workflow (core Git loop)

Check status:

git status
πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026 πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026

Add files:

git add .
πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026 πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026

Commit changes:

git commit -m "your message"
πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026 πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026

Send to GitHub:

git push
πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026 πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026

Get updates:

git pull
πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026 πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026

🟑 Intermediate Git Commands (Real Development Work)

This is where Git starts becoming powerful.


🌿 Branching (VERY important)

Create branch:

git branch feature-branch
πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026 πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026

Switch branch:

git checkout feature-branch
πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026 πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026

Create + switch at once:

git checkout -b feature-branch
πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026 πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026

List branches:

git branch
πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026 πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026

Delete branch:

git branch -d feature-branch
πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026 πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026

πŸ”€ Merging

Switch to main:

git checkout main
πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026 πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026

Merge branch:

git merge feature-branch
πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026 πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026

🌐 Remote repositories

Add remote:

git remote add origin https://github.com/user/repo.git
πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026 πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026

Check remotes:

git remote -v
πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026 πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026

Push branch:

git push origin main
πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026 πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026

Push new branch:

git push -u origin feature-branch
πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026 πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026

πŸ”„ Sync with remote

Fetch changes (no merge):

git fetch
πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026 πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026

Pull changes (fetch + merge):

git pull
πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026 πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026

πŸ”΅ Advanced Git Commands (Professional Level)

These are used in real teams, open source, and production systems.


βͺ Undo changes (VERY important)

Undo last commit (keep changes):

git reset --soft HEAD~1
πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026 πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026

Undo last commit (remove changes):

git reset --hard HEAD~1
πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026 πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026

Undo file changes:

git checkout -- filename
πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026 πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026

Restore file from commit:

git restore filename
πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026 πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026

🧠 Stashing (save work temporarily)

Save changes without committing:

git stash
πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026 πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026

List stashes:

git stash list
πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026 πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026

Apply stash:

git stash apply
πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026 πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026

Remove stash:

git stash drop
πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026 πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026

πŸ” Inspect history

View commits:

git log
πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026 πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026

Compact log:

git log --oneline
πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026 πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026

Graph view:

git log --graph --oneline --all
πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026 πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026

See file changes:

git diff
πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026 πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026

🧩 Rewriting history (advanced)

Edit last commit message:

git commit --amend
πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026 πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026

Squash commits (interactive):

git rebase -i HEAD~3
πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026 πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026

🚨 Conflict handling

When merge conflict happens:

git status
πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026 πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026

Fix files manually β†’ then:

git add .
git commit
πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026 πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026

🌍 Advanced remote control

Change remote URL:

git remote set-url origin NEW_URL
πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026 πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026

Remove remote:

git remote remove origin
πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026 πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026

πŸ§ͺ Cherry-picking (select commits)

Apply specific commit:

git cherry-pick commit-id
πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026 πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026

🧭 Rebase (clean history)

Rebase branch:

git rebase main
πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026 πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026

Continue after conflict:

git rebase --continue
πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026 πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026

Cancel rebase:

git rebase --abort
πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026 πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026

🧠 Git mastery workflow (real-world pattern)

This is what developers actually do:

git checkout -b new-feature
# work on code
git add .
git commit -m "add feature"
git push -u origin new-feature
πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026 πŸ”₯ Jadwal & Hasil: kyl/heres a structured git command guide from basic advanced so you can grow step by step oe - Info Live Streaming 2026

Then open a Pull Request on GitHub.


πŸš€ Beginner β†’ Advanced roadmap

🟒 Beginner

  • git init
  • add / commit / push / pull
  • status

🟑 Intermediate

  • branches
  • merge
  • remote repos
  • fetch

πŸ”΅ Advanced

  • rebase
  • stash
  • cherry-pick
  • reset / revert
  • conflict resolution

πŸ’‘ Final Advice

Don’t try to memorize everything.

Instead focus on:

branch β†’ commit β†’ push β†’ pull request

Everything else builds on that.

Top comments (0)