208 lines
4.8 KiB
Markdown
208 lines
4.8 KiB
Markdown
# 🚀 Git Assignment – My Version Control Journey
|
||
|
||
---
|
||
|
||
## 🛠 Step 1: Verifying Git Installation
|
||
|
||
📌 _First step was making sure Git was installed and working fine._
|
||
|
||

|
||
|
||
✅ The output displayed the installed Git version.
|
||
|
||
---
|
||
|
||
## 📂 Step 2: Checking Repository Status
|
||
|
||
👀 _Next, I checked the repo to see if there were pending changes._
|
||
|
||

|
||
|
||
🔎 Git shows tracked, untracked, and staged files.
|
||
|
||
---
|
||
|
||
## ➕ Step 3: Moving Files to Staging
|
||
|
||
✨ _I noticed some modifications and added them with_ `git add`.
|
||
|
||

|
||
|
||
🗂 Files are now ready to be saved in the next commit.
|
||
|
||
---
|
||
|
||
## 📝 Step 4: Reviewing Commit History
|
||
|
||
📖 _Every commit is part of the project’s story, so I reviewed mine._
|
||
|
||

|
||
|
||
🕒 Shows commit messages, author names, and dates.
|
||
|
||
---
|
||
|
||
## 🔹 Step 5: Simplified Commit Log
|
||
|
||
👾 _To avoid too much detail, I used_ `git log --oneline`.
|
||
|
||

|
||
|
||
⚡ A compact and easy-to-read commit history.
|
||
|
||
---
|
||
|
||
## 🌳 Step 6: Visualizing History with Graph
|
||
|
||
🎨 _History is better when visualized, so I used graph mode._
|
||
|
||

|
||
|
||
🌿 Displays branches and merges clearly.
|
||
|
||
---
|
||
|
||
## 🔍 Step 7: Checking File Changes
|
||
|
||
🖋 _Before committing, I inspected changes with_ `git diff`.
|
||
|
||

|
||
|
||
🔑 Shows exact line changes inside files.
|
||
|
||
---
|
||
|
||
## 🆚 Step 8: Comparing Two Versions
|
||
|
||
⚔️ _To see what changed between two commits, I compared them._
|
||
|
||

|
||
|
||
📌 Helps track project progress over time.
|
||
|
||
---
|
||
|
||
## 🌿 Step 9: Working with Branches
|
||
|
||
🔀 _I explored branches to work independently without touching main code._
|
||
|
||

|
||
|
||
🌱 Branches allow experimentation safely.
|
||
|
||
---
|
||
|
||
## 📥 Step 10: Cloning a Repository
|
||
|
||
🛰 _I downloaded a project from remote using_ `git clone`.
|
||
|
||

|
||
|
||
📂 A full copy is now available locally.
|
||
|
||
---
|
||
|
||
## 📥 Step 11: Pulling Remote Updates
|
||
|
||
🛰 _To stay up to date, I fetched and merged with_ `git pull origin`.
|
||
|
||

|
||
|
||
---
|
||
|
||
## 🌐 Step 12: Checking Remote Connections
|
||
|
||
🔗 _I verified linked remote repositories with_ `git remote -v`.
|
||
|
||

|
||
|
||
---
|
||
|
||
## 🚫 Step 13: Using .gitignore
|
||
|
||
📄 _Added a `.gitignore` file to skip tracking unnecessary stuff._
|
||
|
||

|
||
|
||
---
|
||
## 🔀 Step 14: Performing a Merge
|
||
|
||
⚡ _I merged changes from another branch into my current branch._
|
||
|
||

|
||
|
||
📌 Since both branches had commits, Git created a **3-way merge commit** (not a fast-forward merge).
|
||
|
||
---
|
||
## 📜 Step 15: Inspecting Merge Commit Details
|
||
|
||
👀 _I used `git log -p -- merge.txt` to review the merge commit changes._
|
||
|
||

|
||
|
||
📝 Shows added and modified lines from both branches.
|
||
|
||
---
|
||
## 🗂 Step 16: Checking Simplified Log After Merge
|
||
|
||
⚡ _To quickly see the commit history after the merge, I ran:_
|
||
|
||

|
||
|
||
---
|
||
## 🌳 Step 17: Visualizing All Branches and Merge
|
||
|
||
🎨 Using the graph mode to visualize history clearly:
|
||
|
||

|
||
|
||
🌿 Shows both branches and the merge commit.
|
||
|
||
---
|
||
## Step 18: Blame – Tracking Line History
|
||
|
||
🖊 With git blame, I checked who wrote each line in merge.txt.
|
||
|
||

|
||
|
||
🔑 Each line is attributed to its commit.
|
||
|
||
---
|
||
## 🎯 Step 19: Blame with Line Range
|
||
|
||
🎯 To narrow focus, I ran blame only for lines 1–5.
|
||
|
||

|
||
|
||
---
|
||
|
||
## 📧 Step 20: Blame with Email
|
||
|
||
📧 Finally, I checked the author emails using git blame -e.
|
||
|
||

|
||
|
||
---
|
||
## 🔀 Step 21: Merging Branch `feature/mergeFile` into Main
|
||
|
||
⚡ _I merged the branch `feature/bugReport` into `feature/mergeFile` using the command:_
|
||
|
||

|
||
|
||
---
|
||
# ✨ Summary
|
||
|
||
1. ✅ **Git Version Check** – Verified installation.
|
||
2. ✅ **Git Status** – Checked repository state.
|
||
3. ✅ **Git Add** – Staged changes.
|
||
4. ✅ **Git Log** – Viewed history.
|
||
5. ✅ **Git Log (oneline/graph)** – Short + visual log.
|
||
6. ✅ **Git Diff** – Compared file changes.
|
||
7. ✅ **Git Branch** – Created/checked branches.
|
||
8. ✅ **Git Clone** – Cloned repo locally.
|
||
9. ✅ **Git Pull** – Pulled updates.
|
||
10. ✅ **Git Remote** – Checked remotes.
|
||
11. ✅ **Git Ignore** – Excluded files.
|
||
12. ✅ **Git Merge** – Performed and confirmed a 3-way merge.
|
||
13. ✅ **Git Blame** – Tracked who wrote each line (with -L and -e options).
|
||
--- |