Why version control exists
Understand the idea
A folder of FINAL_v2_actualFINAL copies is not a history. It is a pile of guesses.
The idea
A folder of renamed copies does not tell you which file came from which. A names one whole snapshot and points at the snapshot it grew from. That chain is the history a team can share.
What changes
Nothing in the working files has to change for the idea to matter. What changes is that the group stops guessing. The holds the chain. People still edit files, but the saved history is no longer a second copy of the folder sitting beside the first.
| Habit | What you can answer | What you cannot |
|---|---|---|
| FINAL_v2 folders | Which file looks newest | Which edit came from which |
| A commit chain | What the folder was, and what it grew from | Nothing about parentage |
| A chat log of changes | Who claimed to edit something | The exact bytes at that moment |
The command
You do not need a command to see the problem. Open the terminal on the next lesson and create a repository. Until then, read git log --oneline --graph as the sentence this track is building: each line is a named snapshot, and the graph is how they connect.
The mistake
Check your graph
When you do create the repository, the graph should show one initial commit and a main label. That single node is already more history than a pile of renamed folders.
Your repository
Version control exists so a team can name a snapshot, see who changed it, and return to it without keeping extra copies of the whole file.
Step 1
Look before a repository exists
A folder with no repository has nothing to return to. Run status. If you have not created a repository yet, Git says this is not a repository.
Step 2
The next lesson creates the history
Creating the repository is the first real snapshot. Continue to Repositories and the three states and use the create form there.
The editor edits the working tree. Start a repository and the files appear here.
Commit graph
No commits yet. git init creates the first one.
Quiz
A quick check for understanding. Retry as often as you like; your learning path stays open.
Ready to call this one understood?
Mark this lesson complete to earn 100 XP. You can always revisit it.