2 Commits

Author SHA1 Message Date
1a73cb683a update md file 2025-09-18 11:57:37 +05:30
abc73d0ce2 Added md file 2025-09-18 11:39:14 +05:30
10 changed files with 82 additions and 1 deletions

16
ASSIGNMENT-04-09-2025.md Normal file
View 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?
![git log --graph --oneline --all](git_log_--graph_--oneline_--all.png)

View File

@ -125,7 +125,71 @@
![Git ignore](gitignore_file.png)
---
## 🔀 Step 14: Performing a Merge
_I merged changes from another branch into my current branch._
![git log --merge](git_log_--_merge.txt.png)
📌 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._
![git log -p -- merge.txt](git_log_-p_--_merge.txt.png)
📝 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:_
![git log --oneline -- merge.txt](git_log_--oneline_--_merge.txt.png)
---
## 🌳 Step 17: Visualizing All Branches and Merge
🎨 Using the graph mode to visualize history clearly:
![git log --graph --oneline --all](git_log_--graph_--oneline_--all.png)
🌿 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.
![git blame merge.txt](git_blame_merge.txt.png)
🔑 Each line is attributed to its commit.
---
## 🎯 Step 19: Blame with Line Range
🎯 To narrow focus, I ran blame only for lines 15.
![git blame -L 1,5 merge.txt](git_blame_-L_1,5_merge.txt.png)
---
## 📧 Step 20: Blame with Email
📧 Finally, I checked the author emails using git blame -e.
![git blame -e merge.txt](git_blame_-e_merge.txt.png)
---
## 🔀 Step 21: Merging Branch `feature/mergeFile` into Main
_I merged the branch `feature/bugReport` into `feature/mergeFile` using the command:_
![git merge feature/mergeFile](git_merge.png)
---
# ✨ 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).
---

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

BIN
git_blame_-e_merge.txt.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

BIN
git_blame_merge.txt.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

BIN
git_log_--_merge.txt.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

BIN
git_log_-p_--_merge.txt.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

BIN
git_merge.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB