Compare commits
2 Commits
feature/bu
...
feature/me
Author | SHA1 | Date | |
---|---|---|---|
1a73cb683a | |||
abc73d0ce2 |
16
ASSIGNMENT-04-09-2025.md
Normal file
@ -0,0 +1,16 @@
|
||||
## Q1: Did Git perform a fast-forward merge or a 3-way merge?
|
||||
|
||||
Git performed a **3-way merge**.
|
||||
|
||||
### Explanation:
|
||||
- A **fast-forward merge** happens when the branch pointer can just be moved forward because no new commits exist on the target branch since the branching point.
|
||||
- A **3-way merge** happens when both branches have new commits, and Git needs to create a merge commit by combining changes from both sides.
|
||||
|
||||
In my case, both `feature/bugReport` and `feature/mergeFile` had new commits, so Git created a merge commit.
|
||||
Thus, it was a **3-way merge**.
|
||||
|
||||
---
|
||||
|
||||
## Q2: What does `git log --graph --oneline --all` show after the merge?
|
||||
|
||||

|
@ -125,7 +125,71 @@
|
||||

|
||||
|
||||
---
|
||||
## 🔀 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.
|
||||
@ -139,5 +203,6 @@
|
||||
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).
|
||||
---
|
BIN
git_blame_-L_1,5_merge.txt.png
Normal file
After Width: | Height: | Size: 24 KiB |
BIN
git_blame_-e_merge.txt.png
Normal file
After Width: | Height: | Size: 31 KiB |
BIN
git_blame_merge.txt.png
Normal file
After Width: | Height: | Size: 28 KiB |
BIN
git_log_--_merge.txt.png
Normal file
After Width: | Height: | Size: 42 KiB |
BIN
git_log_--graph_--oneline_--all.png
Normal file
After Width: | Height: | Size: 54 KiB |
BIN
git_log_--oneline_--_merge.txt.png
Normal file
After Width: | Height: | Size: 17 KiB |
BIN
git_log_-p_--_merge.txt.png
Normal file
After Width: | Height: | Size: 44 KiB |
BIN
git_merge.png
Normal file
After Width: | Height: | Size: 55 KiB |