Git for Beginners: Staging, Commits, Branches and Merges (Real Terminal)
Mrs. Tech
0:00 / 0:00
Git for Beginners: Staging, Commits, Branches and Merges (Real Terminal)
6 просмотров · 6 дн. назад
Mrs. Tech
15 подписчиков
6 просмотров · 6 дн. назад
Stop making folders called final-final. Build a small garden plan with Git and watch exactly what gets saved. This original, offline demonstration uses real Git 2.47.3 output: working tree versus staging area, a commit that deliberately leaves a later edit uncommitted, branch pointers, a fast-forward, and a two-parent merge that preserves independent changes.
No GitHub account, remote repository or push is needed for the demonstration. Start in a new disposable practice folder, never in a project you cannot afford to change.
CHAPTERS
0:00 One project, not final-final
0:26 Git is local; hosting is separate
0:57 Start in a disposable folder
1:29 Working tree, staging area, history
2:00 Stage a particular version
2:29 See both differences
2:59 A commit records the staged content
3:30 Save the next checkpoint
3:58 A branch is a moving reference
4:29 Fast-forward: move to an existing commit
5:03 Now let two paths advance
5:33 A real merge with two parents
6:04 Automatic does not mean infallible
6:37 Read the graph instead of guessing
7:08 Your turn: which version gets committed?
7:39 A small, safe practice loop
All terminal states and commit parents are generated by code/demo.py in a fresh, offline test repository using Git 2.47.3. The fixture uses a synthetic Garden Student identity, fixed commit timestamps and an explicitly named main branch so its example history is reproducible. It never changes the production repository or global Git configuration. The animated graph uses A/B/C/D/E/M as teaching labels, not literal commit IDs.
Both merge examples begin from clean working states. The first is a fast-forward; the second changes different files on separate branches and creates a two-parent merge commit. Conflict resolution is explained as a limitation, not falsely demonstrated. Git commits are local, not automatic remote backups. Inspect changes and never commit passwords or tokens.
SOURCES
Git reference — git-add: staging the current file content
https://git-scm.com/docs/git-add
Pro Git — Recording Changes to the Repository
https://git-scm.com/book/en/v2/Git-Basics-...
Git reference — git-switch: create and switch branches
https://git-scm.com/docs/git-switch
Pro Git — Branches in a Nutshell
https://git-scm.com/book/en/v2/Git-Branchi...
Git reference — git-merge: fast-forward and true merges
https://git-scm.com/docs/git-merge
Pro Git — Basic Branching and Merging
https://git-scm.com/book/en/v2/Git-Branchi...
Git reference — git-commit: record the index contents
https://git-scm.com/docs/git-commit
Git reference — git-diff: compare working tree, index and commits
https://git-scm.com/docs/git-diff
Subscribe to Mrs. Tech for programming explained step by step.
#Git #GitForBeginners #VersionControl #LearnProgramming #MrsTech