Glossary of Git Terminology
Add
Moves changes from working directory to staging area.
Bare Repository
Repository without working directory, typically used for sharing.
Blame
Shows line-by-line author attribution for a file.
Branch
Independent line of development.
Checkout
Switch working directory to a branch, commit, or file version.
Clone
Create local copy of remote repository.
Commit
Snapshot of repository state with metadata.
Commit Hash
Unique identifier of commit generated via SHA algorithm.
Conflict
Occurs when Git cannot automatically merge changes.
Detached HEAD
State where HEAD points directly to commit instead of branch.
Diff
Shows changes between versions.
Fetch
Retrieve remote changes without merging.
Fork
Independent server-side copy of repository.
HEAD
Pointer to current commit.
Index (Staging Area)
Intermediate layer before commit.
Merge
Combine histories of branches.
Origin
Default name of primary remote repository.
Pull
Fetch followed by merge.
Push
Upload commits to remote.
Rebase
Reapply commits onto different base.
Remote
External repository reference.
Reset
Move branch pointer and optionally modify working state.
Revert
Create new commit undoing previous change.
SHA
Cryptographic identifier for Git objects.
Stash
Temporary storage of uncommitted changes.
Tag
Named reference to specific commit.
Tree
Directory structure snapshot object.
Working Directory
User-visible project files.
Practical Command Reference
Repository Setup
git init
git clone <url>
Configuration
git config --global user.name "Name"
git config --global user.email "email"
git config --list
Basic Workflow
git status
git add .
git commit -m "message"
git log
Branching
git branch
git branch feature
git checkout feature
git switch feature
Merging and Rebasing
git merge feature
git rebase main
Remote Operations
git remote -v
git fetch
git pull
git push
History Inspection
git log --oneline
git diff
git show <commit>
Undo Operations
git reset HEAD file
git reset --hard HEAD
git revert <commit>
Stash
git stash
git stash list
git stash pop
Tagging
git tag v1.0
git push origin v1.0
Hands-on Exercises
Exercise 1 — First Repository
Task
-
Initialize repository
-
Create file
-
Commit change
Outcome
Understand basic workflow.
Exercise 2 — Branch Workflow
Task
-
Create feature branch
-
Modify file
-
Merge to main
Outcome
Learn branch isolation and merge.
Exercise 3 — Conflict Resolution
Task
-
Modify same line in two branches
-
Merge branches
-
Resolve conflict
Outcome
Develop conflict management skill.
Exercise 4 — Remote Collaboration
Task
-
Clone repository
-
Create branch
-
Push branch
-
Open pull request
Outcome
Practice collaborative workflow.
Exercise 5 — Recovery
Task
-
Delete commit via reset
-
Restore using reflog
Outcome
Learn recovery mechanisms.
Case Studies
Case Study 1 — Startup Team Collaboration
Context
Small distributed team building web application.
Challenges
-
Frequent changes
-
Integration issues
-
Lack of review process
Solution
-
Feature branch model
-
Pull request review
-
CI integration
Outcome
-
Reduced defects
-
Improved collaboration
-
Faster releases
Case Study 2 — Enterprise Monorepo Migration
Context
Large organization consolidating multiple repositories.
Challenges
-
Dependency fragmentation
-
Cross-team coordination
-
Build inconsistency
Solution
-
Monorepo architecture
-
Sparse checkout
-
Central CI pipeline
Outcome
-
Improved visibility
-
Atomic cross-system changes
-
Standardized tooling
Case Study 3 — DevOps GitOps Adoption
Context
Infrastructure managed manually.
Challenges
-
Configuration drift
-
Audit gaps
-
Slow provisioning
Solution
-
Infrastructure as Code
-
GitOps workflow
-
Automated reconciliation
Outcome
-
Deterministic environments
-
Auditability
-
Reduced manual operations
Appendix Materials
Appendix A — Git File Status Lifecycle
Untracked → Modified → Staged → Committed
Appendix B — Git Object Model
| Object | Purpose |
|---|---|
| Blob | File data |
| Tree | Directory structure |
| Commit | Snapshot metadata |
| Tag | Named reference |
Appendix C — Branching Models Overview
| Model | Characteristics |
|---|---|
| Feature branch | Isolated development |
| Gitflow | Structured release cycles |
| Trunk-based | Short-lived branches |
| Fork workflow | External contributions |
Appendix D — Common Git Aliases
git config --global alias.st status
git config --global alias.co checkout
git config --global alias.br branch
git config --global alias.cm commit
git config --global alias.lg "log --oneline --graph"
Appendix E — Recommended Learning Path
-
Basic workflow mastery
-
Branching and merging
-
Collaboration workflows
-
History manipulation
-
Advanced operations
-
Automation and DevOps integration
Appendix F — Troubleshooting Quick Reference
| Issue | Action |
|---|---|
| Wrong commit message | amend |
| Lost commit | reflog |
| Merge conflict | manual resolution |
| Large repo slow | gc and maintenance |
| Push rejected | pull/rebase |
No comments:
Post a Comment