What it is: Git is a free, open-source Distributed Version Control System (DVCS). Every clone is a full repository with complete history, so work continues even offline and collaboration is fast.
- Complete history - Every change to every file is recorded with author, timestamp, and a message—enabling rollbacks, bisects, and fixes to older releases.
- Branching & merging- Safe parallel work on features, fixes, and releases. Merge (or rebase) brings streams back together while surfacing conflicts early.
- Traceability - Link commits to issues (e.g., Jira), annotate intent via messages, and understand why code exists—critical for legacy systems and better estimates.
Git vs. centralized VCS
- Distributed Version Control Systems (DVCSs) (Git): local commits, fast history queries, easy branching, offline work, cheap forks.
- Centralized Version Control Systems (CVCSs) (e.g., SVN) : single server history, simpler mental model but slower branching/merging and needs network access.
Common branching models
- Trunk-Based Development: small, frequent merges to
main; use short-lived feature branches + feature flags.
- Git Flow: long-lived
develop + release/hotfix branches (heavier, suits regulated or scheduled releases).
- GitHub Flow: branch off
main → PR → review → merge → deploy (great for continuous deliver
Terminology
- Branch — a movable pointer to a commit; independent line of development.
- Centralized workflow — everyone commits to a single mainline (e.g., Subversion-style); with Git, this means pushing straight to
main with minimal branching.
- Feature branch workflow — create a branch per feature/fix; open a PR/MR; merge when reviewed.
- Forking — copy a repository into your own namespace (common on GitHub); propose changes via pull requests back upstream.
- Gitflow workflow — a branching model with long-lived
main and develop, plus feature/, release/, and hotfix/ branches.
- HEAD — your current position in history (usually points to the latest commit on the checked-out branch).