Tech Thursday Assignment - 04-09-2025 #3

Open
opened 2025-09-05 12:33:37 +00:00 by jebin.jebamony · 0 comments
Member

Git Assignment: Viewing History, Blame and Merging

Objective

This assignment will help you practice:

  • Viewing file history using git log
  • Viewing line-level changes using git blame
  • Merging branches in Git

Part 1: Viewing File History

  1. Clone any public GitHub repository or create a new one.
  2. Make a few commits modifying the same file (e.g., example.txt).
  3. Run the following commands and note down the output:
    • git log -- example.txt
    • git log -p -- example.txt
    • git log --oneline -- example.txt

Questions to answer in your notes:

  • How many commits modified this file?
  • What differences do you see when adding the -p option?

Part 2: Viewing File History with Blame

  1. Edit the file example.txt by adding several lines in multiple commits.
  2. Use the following commands:
    • git blame example.txt
    • git blame -L 1,5 example.txt
    • git blame -e example.txt

Questions to answer in your notes:

  • Who changed each line of the file?
  • How does -L help when the file is large?
  • What extra information does -e provide?

Part 3: Merging Branches

  1. Create and switch to a new branch:
   git checkout -b feature/feature-1
  1. Modify example.txt and commit the change.

  2. Switch back to main branch and modify the same file in a different way, then commit.

  3. Merge feature/feature-1 into main:

    git merge feature/feature-1
    

Questions to answer in your notes:

  • Did Git perform a fast-forward merge or a 3-way merge?
  • What does git log --graph --oneline --all show after the merge?

Submission

  • Submit your written notes with answers to the questions in a new md file with date - ASSIGNMENT-04-09-2025.md.
  • Include screenshots of your terminal showing commands and outputs.
# Git Assignment: Viewing History, Blame and Merging ## Objective This assignment will help you practice: - Viewing file history using `git log` - Viewing line-level changes using `git blame` - Merging branches in Git --- ## Part 1: Viewing File History 1. Clone any public GitHub repository or create a new one. 2. Make a few commits modifying the same file (e.g., `example.txt`). 3. Run the following commands and note down the output: - `git log -- example.txt` - `git log -p -- example.txt` - `git log --oneline -- example.txt` **Questions to answer in your notes:** - How many commits modified this file? - What differences do you see when adding the `-p` option? --- ## Part 2: Viewing File History with Blame 1. Edit the file `example.txt` by adding several lines in multiple commits. 2. Use the following commands: - `git blame example.txt` - `git blame -L 1,5 example.txt` - `git blame -e example.txt` **Questions to answer in your notes:** - Who changed each line of the file? - How does `-L` help when the file is large? - What extra information does `-e` provide? --- ## Part 3: Merging Branches 1. Create and switch to a new branch: ```bash git checkout -b feature/feature-1 ```` 2. Modify `example.txt` and commit the change. 3. Switch back to `main` branch and modify the same file in a different way, then commit. 4. Merge `feature/feature-1` into `main`: ```bash git merge feature/feature-1 ``` **Questions to answer in your notes:** * Did Git perform a fast-forward merge or a 3-way merge? * What does `git log --graph --oneline --all` show after the merge? --- ## Submission * Submit your written notes with answers to the questions in a new md file with date - ASSIGNMENT-04-09-2025.md. * Include screenshots of your terminal showing commands and outputs.
ajin.vijayakumar was assigned by jebin.jebamony 2025-09-05 12:33:37 +00:00
ajishini.chandrasekar was assigned by jebin.jebamony 2025-09-05 12:33:37 +00:00
Arjun.Gopi was assigned by jebin.jebamony 2025-09-05 12:33:37 +00:00
asaph.johnwesley was assigned by jebin.jebamony 2025-09-05 12:33:37 +00:00
ashish.livingston was assigned by jebin.jebamony 2025-09-05 12:33:37 +00:00
gokul.subramonian was assigned by jebin.jebamony 2025-09-05 12:33:37 +00:00
jaya.lekshmi was assigned by jebin.jebamony 2025-09-05 12:33:37 +00:00
leyo.whiteson.rabertsingh was assigned by jebin.jebamony 2025-09-05 12:33:37 +00:00
Magdel was assigned by jebin.jebamony 2025-09-05 12:33:37 +00:00
muralikrishnan.rajamuni was assigned by jebin.jebamony 2025-09-05 12:33:37 +00:00
nikhil.samuel was assigned by jebin.jebamony 2025-09-05 12:33:37 +00:00
rahul.bruce was assigned by jebin.jebamony 2025-09-05 12:33:37 +00:00
renejit.vedamoni was assigned by jebin.jebamony 2025-09-05 12:33:37 +00:00
solomon.antony was assigned by jebin.jebamony 2025-09-05 12:33:37 +00:00
vipinraj.vijayakamaladas was assigned by jebin.jebamony 2025-09-05 12:33:37 +00:00
Sign in to join this conversation.
No description provided.