Added the headings for assignment

This commit is contained in:
2025-08-20 17:37:38 +05:30
parent 351c9c3018
commit 12227824b1

View File

@@ -2,13 +2,28 @@
# Git Assignment
## 1. What is Git and Version Control
What problem does Git solve?
Git solves the problem of tracking changes in files (especially code) and managing collaboration between multiple people. Without Git, its difficult to know who made what changes, when, and why. Git lets you save different versions of your project, go back to earlier versions if something breaks, and merge changes from different people without overwriting each others work.
Real-life example where multiple people edit the same file:
A school group project where everyone is writing different sections of a report in the same Word/Google Doc file. Each student edits parts of the document, and the changes need to be combined into one final version.
Why is version control better than emailing files back and forth?
With email, you end up with many copies of the same file (e.g., report_final.docx, report_final2.docx, report_really_final.docx), which is confusing.Its easy to lose track of who made which changes.If two people edit the same section, you must manually merge them, which can cause mistakes.
Version control (like Git) keeps one central version of the file, records who made each change, and can automatically merge changes. This makes collaboration smoother, avoids confusion, and provides a history to undo mistakes if needed.
## Git Version Check
![Git version check](git_version.png)
---
## Git Username
## 2. Installing Git & Configuring User Info
![Git status](git_username.png)
@@ -20,12 +35,16 @@
---
## 3. Initializing a Repository
## Git Init
![Git add](git_init_status.png)
---
## 4. Working Directory, Staging, and Commits
## Git Add
![Git add](git_adding_notes.png)
@@ -35,12 +54,16 @@
---
## Git Log
## 5. Adding & Committing Files
## Git Log
![Git log](gitlog.png)
![Git log](git_log.png)
---
## 6. Viewing Commit Logs & Diffs
## Git Log (graph)
![Git log graph](onelinegraph.png)
@@ -59,11 +82,3 @@
---
### Notes:
1. **Git Version Check** Confirms the installed Git version.
2. **Git Status** Shows the current working tree status, including staged/unstaged changes.
3. **Git Add** Adds changes to the staging area, preparing them for commit.
4. **Git Log** Displays commit history.
5. **Git Log (oneline/graph)** Shows simplified or visual commit history.
6. **Git Diff** Shows changes between commits or working directory states.