Advanced Git Workflows
Advanced Git workflows are team rules and history-editing techniques for moving changes from individual branches into shared releases. They help you keep collaboration predictable while you review, integrate, backport, debug, and recover changes.
itDevOps and software delivery | OpenSkills.info
Course pathWalk it in order
Look it upDip in anytime
Go furtherLeaves this page
Don't Panic
Don't Panic — Advanced Git Workflows
Git workflow is the agreement around Git's commit graph: where work starts, who examines it, which checks count, and how a change becomes shared history. Git supplies commits, branches, and remotes. It does not arrive with a small committee in the box to settle every integration argument, which is considerate of it and occasionally inconvenient.
The important picture is small. A commit is a saved snapshot with parent links. A branch is a movable name pointing at one commit. From there, most advanced operations either join histories, move a name, or manufacture replacement commits. The files can look identical after a rewrite; the commit identity is not. That distinction is where many cheerful-looking disasters begin.
Keep one boundary in view: private work is clay, shared work is infrastructure. On a private topic branch, interactive rebase can reorder, combine, edit, or split commits until the sequence tells a useful story. Once other people, automated checks, or maintenance branches depend on those commits, rewriting them hands repair work to everyone downstream. The graph is not being dramatic. It is keeping receipts.
Integration is a choice about what future readers need. A merge preserves the moment two lines of work came together. A rebase replaces a series on a newer base. A squash retains one combined result but leaves the topic's internal checkpoints behind. Cherry-pick has a narrower job: carry one selected fix to another branch as a new commit, such as a maintenance backport. It is a scalpel, not an assembly line.
The awkward parts have names because they recur. Rerere can remember a conflict resolution, but it cannot decide whether the remembered result still makes sense. Worktree gives one repository more than one checkout, which is handy when a hotfix interrupts a feature. Bisect narrows a good-to-bad range when a regression has hidden among the commits like a cat under a duvet.
Start with the slides for the graph and integration choices. Keep the cheatsheet open when deciding whether to merge, rebase, squash, or cherry-pick. Use the practice reference to rehearse the commands and recovery paths in a disposable repository. The exercise then turns those separate moves into one observable backport workflow. The aim is not a pretty graph. It is a team that can move changes, preserve evidence, and recover when the graph objects.
Where this skill leads
Relevant careers
See how this topic contributes to broader role-level skill maps.
Sources
- https://git-scm.com/book/en/v2/Git-Branching-Branches-in-a-Nutshell
Supports
- Commits contain parent links that form history
- A branch is a movable reference to a commit
- Git branching and merging are lightweight workflow mechanisms
- https://git-scm.com/book/en/v2/Git-Branching-Basic-Branching-and-Merging
Supports
- Topic and hotfix branch workflow
- Three-way merge using two branch tips and their common ancestor
- Merge conflict state and resolution flow
- https://git-scm.com/book/en/v2/Git-Branching-Branching-Workflows
Supports
- Long-running branches for stability stages
- Topic branches for isolated work and review
- Local nature of branch and merge operations
- https://git-scm.com/book/en/v2/Distributed-Git-Distributed-Workflows
Supports
- Centralized workflow
- Integration-manager workflow
- Hierarchical distributed workflow
- Ability to combine workflow characteristics
- https://git-scm.com/book/en/v2/Git-Branching-Rebasing
Supports
- Merge and rebase as two ways to integrate changes
- Rebase replays committed changes on another base
- Rebase creates replacement commits
- Warning against rebasing commits that collaborators use
- https://git-scm.com/docs/git-rebase
Supports
- Rebase transplants commits to a different starting point
- Interactive rebase can reorder or combine commits
- Commit splitting and rebasing merges
- Continue, skip, abort, quit, and edit-todo controls
- Recovery concerns after an upstream branch is rewritten
- https://git-scm.com/docs/git-merge
Supports
- Merge joins development histories
- Fast-forward and non-fast-forward behavior
- Squash mode prepares the combined effect without making a merge commit
- Continue, abort, and quit controls
- Merge strategies and conflict options
- https://git-scm.com/docs/git-cherry-pick
Supports
- Cherry-pick applies changes introduced by existing commits
- A new commit is recorded for each applied change by default
- Clean working-tree requirement
- Continue, skip, abort, and quit controls
- Selective change transfer and backport example
- https://git-scm.com/docs/git-rerere
Supports
- Rerere reuses recorded conflict resolutions
- Repeated-conflict use case for long-lived topic branches
- Status, diff, forget, clear, and garbage-collection operations
- https://git-scm.com/docs/git-worktree
Supports
- One repository can have a main working tree and linked working trees
- More than one branch can be checked out at the same time
- Add, list, lock, move, prune, remove, repair, and unlock operations
- https://git-scm.com/docs/git-bisect
Supports
- Binary search between known endpoints
- Good and bad or old and new classification
- Automated classification with bisect run
- Reset after a bisect session
- https://git-scm.com/book/en/v2/Git-Branching-Branch-Management
Supports
- Merged and unmerged branch filters
- Safe branch deletion checks
- Local and remote branch naming considerations
- https://git-scm.com/docs/githooks
Supports
- Client-side and server-side Git hook trigger points
- Hook installation in a repository hooks directory
- Hook exit status can allow or stop specific operations
- https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks
Supports
- Client-side hooks are not copied when a repository is cloned
- Local hooks support workflow checks but do not alone enforce a policy for all clones
- https://github.com/sindresorhus/awesome
Supports
- Starting point for topic-specific awesome-list discovery
- Git add-on, Git hook, and Git workflow list categories
- https://github.com/dictcp/awesome-git
Supports
- Discovery of pre-commit, Lefthook, Tig, and git-absorb
- Curated Git workflow, hook-management, tools, and extension categories
- https://pre-commit.com/
Supports
- Multi-language Git hook management
- Project configuration and hook environment installation
- Local and continuous-integration execution
- https://lefthook.dev/
Supports
- Project-configured Git hook management
- Parallel hook jobs and file selection
- Hook installation into the repository
- https://jonas.github.io/tig/doc/manual.html
Supports
- Terminal interface for browsing Git repository changes
- Commit range, reference, diff, and log inspection
- Pager mode for Git command output
- https://github.com/tummychow/git-absorb
Supports
- Automatic assignment of staged changes to fixup commits
- Optional autosquash integration
- Safety behavior for changes that cannot be assigned
- Recovery through the pre-absorption reference
- https://github.com/git/git/commit/e83c5163316f89bfbde7d9ab23ca2e25604af290
Supports
- Git's initial public commit dates from April 2005
- https://github.com/git/git/blob/v1.0.0/Documentation/RelNotes-1.0.0.txt
Supports
- Git 1.0 was released in December 2005
- https://github.com/git/git/blob/v1.5.6/Documentation/RelNotes-1.5.6.txt
Supports
- Git 1.5.6 introduced recorded resolution reuse
- https://github.com/git/git/blob/v2.5.0/Documentation/RelNotes/2.5.0.txt
Supports
- Git 2.5 introduced the git worktree command in 2015
- https://github.com/git/git/blob/v2.19.0/Documentation/RelNotes/2.19.0.txt
Supports
- Git 2.19 introduced range-diff for comparing patch series
- https://github.com/git/git/blob/v2.23.0/Documentation/RelNotes/2.23.0.txt
Supports
- Git 2.23 introduced switch and restore commands
- https://github.com/git/git/blob/v2.28.0/Documentation/RelNotes/2.28.0.txt
Supports
- Git 2.28 added init.defaultBranch configuration
- https://github.com/git/git/blob/v2.29.0/Documentation/RelNotes/2.29.0.txt
Supports
- Git 2.29 added Scalar as a contribution
- https://github.com/git/git/blob/v2.38.0/Documentation/RelNotes/2.38.0.txt
Supports
- Git 2.38 made Scalar a built-in command
- https://github.com/
Supports
- GitHub provides repository collaboration features
- https://about.gitlab.com/
Supports
- GitLab provides a DevSecOps platform with source code management
- https://bitbucket.org/product/
Supports
- Bitbucket connects Git repositories with pull requests, pipelines, and Jira
- https://azure.microsoft.com/products/devops/
Supports
- Azure DevOps provides Git repositories and pull-request policies
- https://www.gerritcodereview.com/
Supports
- Gerrit provides Git-based code review and repository workflow controls
