0
0
Gitdevops~10 mins

What is Git - Visual Explanation

Choose your learning style9 modes available
Process Flow - What is Git
Start: Create Project Files
Initialize Git Repository
Track Changes with Git
Commit Changes
View History
Collaborate by Sharing Repository
Update and Commit Again
Repeat as Project Grows
This flow shows how Git tracks changes in a project from start to collaboration by saving snapshots called commits.
Execution Sample
Git
git init
# Initialize a new Git repository

git add .
# Stage all files for commit

git commit -m "Initial commit"
# Save snapshot of current files
This code initializes a Git repository, stages all files, and commits them as the first snapshot.
Process Table
StepCommandActionResult
1git initCreate .git folder to track projectRepository initialized, ready to track changes
2git add .Stage all current files for commitFiles are marked to be saved in next commit
3git commit -m "Initial commit"Save snapshot of staged filesCommit created with message 'Initial commit'
4git statusCheck repository statusNo changes to commit, working directory clean
💡 No more commands; repository is set up and initial files are saved
Status Tracker
VariableStartAfter git initAfter git add .After git commit
Repository StateNo Git trackingGit folder createdFiles staged for commitFiles committed (snapshot saved)
Key Moments - 2 Insights
Why do we need to run 'git add' before 'git commit'?
'git add' tells Git which files to include in the next snapshot. Without adding, 'git commit' saves nothing new. See execution_table step 2 and 3.
What does 'git init' actually do?
'git init' creates a hidden folder (.git) that stores all information Git needs to track changes. It does not save files yet. See execution_table step 1.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution table, what is the result after running 'git init'?
ARepository initialized, ready to track changes
BFiles are marked to be saved in next commit
CCommit created with message 'Initial commit'
DNo changes to commit, working directory clean
💡 Hint
Check the 'Result' column for step 1 in the execution_table
At which step are files actually saved as a snapshot in Git?
AStep 1
BStep 2
CStep 3
DStep 4
💡 Hint
Look at the 'Action' and 'Result' columns in execution_table step 3
If you skip 'git add' and run 'git commit' directly, what happens?
AGit saves all files automatically
BGit saves only previously staged files
CGit shows an error and stops
DGit deletes all files
💡 Hint
Refer to key_moments about the role of 'git add' before 'git commit'
Concept Snapshot
Git is a tool to track changes in project files.
Use 'git init' to start tracking.
Use 'git add' to select files to save.
Use 'git commit' to save snapshots.
Snapshots let you see history and collaborate.
Full Transcript
Git helps you save versions of your project files. First, you create files. Then, you run 'git init' to start a Git repository. This creates a hidden folder to track changes. Next, you use 'git add' to tell Git which files to save. Finally, 'git commit' saves those files as a snapshot with a message. You can check status anytime with 'git status'. This process repeats as you update your project, letting you keep history and work with others.