Version Control and Collaboration
-
Git Working Tree, Index, and Commit
Git can distinguish the files you are editing, the contents chosen for the next commit, and the last recorded snapshot.
-
Reading a Small Git Diff
A line diff shows how one selected version of a file changes into another, with nearby unchanged lines for context.
-
Staging Selected Changes for a Commit
The index lets one commit record a coherent change even when a file also contains other edits that belong elsewhere.
-
A Git Commit as a Snapshot with Parents
A commit identifies project contents, ancestry, and metadata. The difference a reader sees is obtained by comparing that snapshot with another one.
-
A Git Branch as a Moving Reference
A local branch names a commit at the tip of a line of work. New commits on the active branch normally advance that reference.
-
HEAD and a Detached Checkout
HEAD normally identifies the active branch. A detached checkout can make it point directly to a commit for inspection.
-
Recognizing a Fast-Forward Update
A branch can fast-forward when its existing tip is an ancestor of the requested new tip, so updating the reference does not discard its ancestry.
-
How a Git Merge Commit Connects Histories
A two-parent merge commit records a result reached by integrating two lines of development and preserves both tips as parents.
-
Resolving a Git Merge Conflict by Behavior
A conflict indicates that Git could not automatically choose a combined result for part of the history. The resolution should express current intent.
-
Git Fetch and Local Knowledge of a Remote
Fetch obtains objects and updates configured remote-tracking references. It can show what changed on a server without integrating those changes into the active branch.
-
Git Pull as Fetch Plus Integration
Pull obtains remote changes and then integrates according to the invocation and configuration. The two phases can have different outcomes.
-
Git Push and the Remote Branch Tip
A push sends needed objects and requests reference updates on the remote. Succeeding on one branch does not advance another branch.
-
Rebase Changes Commit Ancestry
Rebase reapplies changes from one line of work on another base. The resulting commits have new ancestry and may have different contents after conflicts.
-
Reverting a Change in Shared History
A revert can record an inverse change as a new commit while preserving the original change in ancestry.
-
Applying One Earlier Change on Another Branch
Cherry-picking applies the changes introduced by a chosen commit to the current line, ordinarily creating a new commit with a new parent.
-
Tags and Release Names in Git
A tag gives a stable conventional name to a release point. An annotated tag is a separate object carrying metadata and possibly a signature.
-
Ignored Paths and Already Tracked Files
Ignore rules primarily affect which untracked paths are considered for ordinary addition. A tracked file stays in history when a matching rule is added.
-
Reading Commit History for One Path
A path-limited history can show commits affecting a selected file or directory under the chosen history and simplification options.
-
Finding the First Failing Commit with Bisect
A bisect narrows a known good-to-bad history using repeated classifications of intermediate commits.
-
Reading Line Attribution as History Evidence
Line attribution can show which recorded change last touched a line in a selected history. It supplies a starting point for understanding a decision.
-
Temporarily Shelving an Uncommitted Experiment
Git can save certain working-tree and index changes for later use while another task uses the same checkout.
-
Understanding Short Git Status
Short status separates changes selected in the index from working-tree changes. The two positions can tell different stories about one path.
-
Writing Commit Messages That Preserve Decisions
A useful commit message identifies the observable change and records important reasoning that a later reader cannot infer from the diff alone.
-
Reviewing a Change Commit by Commit
A series of commits can show the internal steps behind an overall change. Compare each relevant snapshot as well as the final integrated result.
-
Reviewing a Tracked Binary Artifact
A binary artifact often cannot be reviewed through a line diff. Inspect its producer, expected use, and independently observable properties.
-
Keeping Line Endings Consistent Across Git Checkouts
Git can normalize line endings on check-in and choose line endings in a working tree through configured attributes and settings.
-
Keeping Generated Artifacts Out of Unrelated Commits
A build can leave untracked output or modify tracked generated files. Review each artifact against the change's intended public result.
-
Reviewing a Configuration Change in Version Control
A configuration edit deserves the same attention to defaults, precedence, and compatibility as a code edit.
-
Connecting a Deployment to a Git Commit
A deployment should be traceable to the source commit that was built, which may differ from the latest commit visible on a hosting service.
-
Checking Local Work Before Switching Branches
Before changing a checkout, identify staged, unstaged, and untracked work and decide how each part should be retained.