131 lines
2.3 KiB
Markdown
131 lines
2.3 KiB
Markdown
<!-- @format -->
|
||
|
||
# Git Assignment
|
||
|
||
## 1. What is Git and Version Control
|
||
|
||
What problem does Git solve?
|
||
Git tracks changes in files (especially code) and helps multiple people collaborate without overwriting each other’s work. It lets you save versions, go back if something breaks, and merge changes safely.
|
||
|
||
Real-life example:
|
||
A school group project where everyone writes different parts of the same report. Git combines everyone’s edits into one final version without losing work.
|
||
|
||
Why is Git better than emailing files?
|
||
Emailing creates many confusing copies (e.g., report_final.docx, report_final2.docx). Git keeps a single version, records who changed what, and merges edits automatically, making collaboration easier and safer.
|
||
|
||
|
||
## Git Version Check
|
||
|
||

|
||
|
||
---
|
||
|
||
## 2. Installing Git & Configuring User Info
|
||
|
||

|
||
|
||
---
|
||
|
||
## Git List
|
||
|
||

|
||
|
||
---
|
||
|
||
## 3. Initializing a Repository
|
||
|
||
## Git Init
|
||
|
||

|
||
|
||
---
|
||
|
||
## 4. Working Directory, Staging, and Commits
|
||
|
||
## Git Add
|
||
|
||

|
||

|
||

|
||

|
||
|
||
---
|
||
|
||
## 5. Adding & Committing Files
|
||
|
||
## Git Log
|
||

|
||
|
||
---
|
||
|
||
## 6. Viewing Commit Logs & Diffs
|
||
|
||
## Git Log (graph)
|
||
|
||

|
||
|
||
---
|
||
|
||
## Git Diff
|
||
|
||

|
||
|
||
---
|
||
|
||
## Git Diff (commit1 vs commit2)
|
||
|
||

|
||
|
||
---
|
||
|
||
## 7. Creating & Switching Branches
|
||
|
||
## Git Branch
|
||
|
||

|
||

|
||

|
||
|
||
|
||
---
|
||
|
||
## 8. Cloning a Remote Repository
|
||
|
||
## Git Clone
|
||
|
||

|
||

|
||
|
||
---
|
||
|
||
## 9. Adding & Managing Remotes
|
||
|
||
## Git Remote
|
||
|
||

|
||
|
||
---
|
||
|
||
## 10. Pushing & Pulling Changes
|
||
|
||
## Git Pull
|
||
|
||

|
||

|
||

|
||
|
||
|
||
## Git Push
|
||
|
||

|
||
|
||
---
|
||
|
||
## 11. Ignoring Files with .gitignore
|
||
|
||
## .gitignore
|
||
|
||

|
||

|
||
|
||
--- |