Files
git-practice-Vipin/GIT_ASSIGNMENT.md
2025-09-11 10:44:19 +05:30

4.3 KiB
Raw Blame History

🌟 Git Assignment My Version Control Journey


🛠 Step 1: Checking Git Version

📌 Before starting, I made sure Git was installed and working properly.

Git version check

Output confirms the installed version of Git.


📂 Step 2: Checking Git Status

👀 Time to check the working directory status… are there any changes?

Git status

🔎 Git shows which files are staged, unstaged, or untracked.


Step 3: Adding Files to Staging

Changes spotted! Lets move them to the staging area with git add.

Git add

🗂 Files are now ready to be committed.


📝 Step 4: Viewing Commit History

📖 Every project tells a story… heres mine!

Git log

🕒 A detailed timeline of commits, complete with author, date, and messages.


🔹 Step 5: Compact History (Oneline)

👾 Too much detail? Lets simplify it with git log --oneline.

Git log oneline

Quick and clean history view.


🌳 Step 6: Visual History (Graph)

🎨 Why read history when you can see it?

Git log graph

🌿 Branches and merges, beautifully visualized.


🔍 Step 7: Checking Differences

🖋 Curious about what exactly changed? Enter git diff.

Git diff

🔑 Shows line-by-line modifications before committing.


🆚 Step 8: Comparing Two Commits

⚔️ What changed between two versions of history?

Git diff between two commits

📌 Helps track evolution between commits.


🌿 Step 9: Exploring Branches

🔀 Time to branch out!

Git branch

🌱 Branches allow experimenting without breaking the main code.


📥 Step 10: Cloning a Repository

🛰 Finally, bringing a repo from remote to local with git clone.

Git clone

📂 A complete copy of the project, ready to explore and edit.


📥 Step 11: Pulling the Code

🛰 Fetched and merged updates from the remote repository using git pull origin.

Git pull


🌐 Step 12: Checking Remote

🔗 Verified remote repository connections with git remote -v.

Git remote


🚫 Step 13: Ignore File

📄 Added a .gitignore file to exclude unnecessary files like logs or temporary data.

Git ignore


📜 Step 14: Viewing File History

📖 Checked the history of changes for a specific file using git log filename.

File history

Shows all commits that modified the file, with author, date, and commit messages.


🕵️ Step 15: Git Blame

🔎 Tracked who last modified each line of a file using git blame filename.

Git blame

📌 Useful to identify responsibility for specific lines.


Wrap-Up Notes

  1. Git Version Check Confirmed installation.
  2. Git Status Checked working tree status.
  3. Git Add Staged changes for commit.
  4. Git Log Viewed commit history.
  5. Git Log (oneline/graph) Simplified and visual history.
  6. Git Diff Compared changes in files and commits.
  7. Git Branch Managed branches.
  8. Git Clone Pulled repo from remote.
  9. Git Pull Synced changes from remote.
  10. Git Remote Checked repository connections.
  11. Git Ignore Excluded unnecessary files.
  12. Git File History & Blame Tracked changes and contributors line by line.

Questions & Answers

🔢 How many commits modified this file?

Ans: 1


🧩 What differences do you see when adding the -p option?

Ans:

  • Without -p → Only commit metadata (hash, author, date, message).
  • With -p → Shows the actual diff (patch), i.e., the lines added (+) or removed (-) in each commit.

👤 Who changed each line of the file?

Ans: vipinraj01


📏 How does -L help when the file is large?

Ans: It limits the log output to specific lines, e.g., shows commit history only for lines 2040 of the file.


📧 What extra information does -e provide?

Ans: It shows the authors email address alongside their name, useful when multiple contributors have the same display name.