Conflict Resolution
A conflict occurs when two branches have made **different changes to the same line(s)** of the same file, and Git cannot automatically determine which version.
A conflict occurs when two branches have made **different changes to the same line(s)** of the same file, and Git cannot automatically determine which version.
[Conventional Commits](https://www.conventionalcommits.org) is a lightweight convention for writing commit messages in a machine-readable, human-understandable.
`git add` moves changes from your **working tree** into the **index** (also called the staging area). Think of the index as a draft of your next commit — you.
`git bisect` performs a **binary search through commit history** to efficiently find the exact commit that introduced a bug. Instead of checking commits one by.
A branch in Git is a **lightweight movable pointer** to a commit. Creating a branch costs nothing — it is just a 41-byte file containing a SHA. When you commit.
`git cherry-pick` copies one or more commits from anywhere in the repository and applies them to the current branch as new commits. The original commits remain.
`git commit` takes everything in the **index (staging area)** and creates a permanent, immutable snapshot in the repository. Each commit has:
Git configuration exists at three scopes, each overriding the one above it:
**The golden rule:** Prefer `git fetch` + manual inspect over `git pull` when you want to see what's changed before integrating. Use `git pull --rebase` for.
A **fixup** commit is a special type of squash commit that targets a specific earlier commit for amendment. When you run `git rebase --autosquash`, Git.
**Git Flow** is a branching model designed by Vincent Driessen for projects with scheduled, versioned releases. It defines a strict set of branch types and.
**Git hooks** are scripts that Git automatically executes before or after specific events (commit, push, merge, etc.). They live in `.git/hooks/` and can be.
**Git** is a distributed version control system (VCS) created by Linus Torvalds in 2005. Every developer has a full copy of the repository — including its.
`git log` shows the commit history of the current branch — or any branch, range, file, or author you specify.
`git merge` integrates the history of one branch into another. It finds the **common ancestor** of the two branches and combines their changes, creating a new.
`git push` uploads your local commits to a remote repository, making them available to other team members. It transfers only the objects (commits, trees.
`git rebase` moves or replays a sequence of commits onto a new base. It rewrites commit history by creating **new commits** with the same changes but different.
The **reflog** (reference log) is a local journal of every place `HEAD` and your branch pointers have pointed to, in chronological order. Every time you.
A **remote** is a named reference to another Git repository — typically hosted on GitHub, GitLab, Bitbucket, or an internal server. A remote stores a URL and a.
**Rule of thumb:** - Use `git reset` on **local, unpushed** changes - Use `git revert` on **pushed or shared** history
**Squashing** combines multiple commits into a single commit. This is used to clean up a messy feature branch before merging — turning a series of `wip`, `fix.
`git stash` temporarily shelves (stashes) your uncommitted changes — both staged and unstaged — so you can switch context without committing half-finished.
`git status` shows the state of your working tree and index relative to the current `HEAD` commit.
A **submodule** is a Git repository embedded inside another Git repository. The parent repository stores a reference to a specific commit of the submodule —.
A **tag** is an immutable pointer to a specific commit — unlike a branch, it never moves. Tags are used to mark release points (`v1.2.0`), milestones, or any.
`git worktree` lets you check out **multiple branches simultaneously**, each in its own directory, all sharing the same `.git` repository. No stashing, no.
A pull request (PR) is a unit of communication as much as it is a unit of code change. A good PR:
**Trunk-Based Development (TBD)** is a branching strategy where all developers integrate their changes into a single shared branch (`main` / `trunk`) multiple.