Skip to content

Latest commit

 

History

11 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

📘 Git Learning Project

This repository is a hands-on Git learning project.
It covers Git fundamentals, branching, merging, undoing changes, and working with remote repositories (GitHub).

The goal is to understand Git practically, not just theoretically.


📌 What I Learned

  • Initializing a Git repository
  • Tracking files and committing changes
  • Understanding commit history
  • Working with branches
  • Merging branches
  • Undoing mistakes safely
  • Working with remote repositories (GitHub)
  • Fetching, pulling, and comparing changes

🚀 Git Commands Used (With Explanation)

🔹 Repository Initialization

git init

🔹 Adding Files to Staging Area

git add .

🔹 Committing Changes

git commit -m "first commit"

🔹 Checking Repository Status

git status

🔹 Viewing Commit History

git log
git log --oneline

🌿 Branching

🔹 View Existing Branches

git branch

🔹 Change name of the branch

git branch -M main

🔹 Create a New Branch

git branch feature-x

🔹 Switch to a Branch

git checkout feature-x
# or
git switch feature-x

🔹 Merge a Branch (run from main/master)

git merge feature-x

⏪ Time Travel & Fixing Mistakes

🔹 Create a Branch from an Old Commit

git checkout -b fix-from-old 1300f39

🔹 Restore File to Last Commit

git restore notes.txt

🔹 Remove Last Commit (Keep Changes)

git reset --soft HEAD~1

🔹 Remove Last Commit (Delete Changes)

git reset --hard HEAD~1

🔹 Safely Undo a Commit

git revert <commit-hash>

🌍 Working with Remote Repositories (GitHub)

🔹 Fetch Remote Changes (Without Applying)

git fetch origin

🔹 View Fetched Changes

git log origin/main
git diff main origin/main

🔹 Fetch + Merge Remote Changes

git pull origin main

🧠 Key Concepts Learned

  • Working Directory → Staging Area → Commit
  • Branches are pointers to commits
  • Fast-forward vs 3-way merge
  • Detached HEAD state
  • Reset vs Revert
  • Fetch vs Pull
  • Safe vs destructive Git commands

🎯 Purpose of This Repository

This repo is meant for:

  • Learning Git step by step
  • Practicing real commands
  • Understanding mistakes and recovery
  • Building strong Git fundamentals

🙌 Author

Jubair Abdulla
Learning Git the right way — by practicing 🚀

About

A hands-on repository for learning Git fundamentals, branching, merging, and GitHub workflows.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors