# 🌟 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](gitversion.png) βœ… 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](gitstatus.png) πŸ”Ž Git shows which files are staged, unstaged, or untracked. --- ## βž• Step 3: Adding Files to Staging ✨ _Changes spotted! Let’s move them to the staging area with_ `git add`. ![Git add](gitadd.png) πŸ—‚ Files are now ready to be committed. --- ## πŸ“ Step 4: Viewing Commit History πŸ“– _Every project tells a story… here’s mine!_ ![Git log](gitlog.png) πŸ•’ A detailed timeline of commits, complete with author, date, and messages. --- ## πŸ”Ή Step 5: Compact History (Oneline) πŸ‘Ύ _Too much detail? Let’s simplify it with_ `git log --oneline`. ![Git log oneline](gitoneline.png) ⚑ Quick and clean history view. --- ## 🌳 Step 6: Visual History (Graph) 🎨 _Why read history when you can see it?_ ![Git log graph](loggraph.png) 🌿 Branches and merges, beautifully visualized. --- ## πŸ” Step 7: Checking Differences πŸ–‹ _Curious about what exactly changed? Enter_ `git diff`. ![Git diff](gitdiff.png) πŸ”‘ Shows line-by-line modifications before committing. --- ## πŸ†š Step 8: Comparing Two Commits βš”οΈ _What changed between two versions of history?_ ![Git diff between two commits](compare.png) πŸ“Œ Helps track evolution between commits. --- ## 🌿 Step 9: Exploring Branches πŸ”€ _Time to branch out!_ ![Git branch](branch.png) 🌱 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](clone.png) πŸ“‚ 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](pull.png) --- ## 🌐 Step 12: Checking Remote πŸ”— _Verified remote repository connections with_ `git remote -v`. ![Git remote](remote.png) --- ## 🚫 Step 13: Ignore File πŸ“„ _Added a `.gitignore` file to exclude unnecessary files like logs or temporary data._ ![Git ignore](ignore.png) --- ## πŸ“œ Step 14: Viewing File History πŸ“– _Checked the history of changes for a specific file using_ `git log filename`. ![File history](filehistory.png) βœ… 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](blame.png) πŸ“Œ Useful to identify responsibility for specific lines. --- ## πŸ”€ Step 16: Git Merge πŸ”— _Merged changes from one branch into another using_ `git merge branchname`. ![Git merge](merge.png) πŸ“Œ Helps integrate changes from different branches into the main branch. --- ## 🌐 Step 17: Git Log (All, Oneline Graph) πŸ“Š _Viewed a compact, visual history of all commits across branches using_ `git log --oneline --graph --all`. ![Git graph all](graphall.png) πŸ“Œ Great for visualizing the entire project history at a glance. --- # ✨ 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. 13. βœ… **Git Merge** – Combined branch histories. 14. βœ… **Git Graph (all, oneline)** – Visualized all commits and branches. --- # ❓ 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 20–40** of the file. --- ### πŸ“§ What extra information does `-e` provide? **Ans:** It shows the **author’s email address** alongside their name, useful when multiple contributors have the same display name.