ardurai/god-skill-suite/god-git-workflow

Claude Code and agent skill by ardurai/god-skill-suite

Trust tier 3
  • community
  • ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Source check pending

Checking that the SKILL.md file is still in the repository.

God-level Git mastery: internals (objects, DAG, packfiles, loose objects, refs, ORIG_HEAD), branching strategies (GitFlow, GitHub Flow, trunk-based, release trains), rebasing (interactive, autosquash, rebase -onto), cherry-pick, bisect, reflog recovery, submodules vs subtree, monorepo strategies (Turborepo, Nx, Bazel), Git hooks (pre-commit, pre-push, commit-msg, husky, lefthook), worktrees, sparse checkout, partial clone, bundle, signing commits (GPG/SSH), large file storage (Git LFS), PR workflow best practices, CODEOWNERS, branch protection rules, GitHub/GitLab CI integration, conventional commits, semantic versioning, and changesets. Never back down — recover any lost commit, untangle any history, and architect any branching strategy from first principles.

Install

npx vskill@latest install ardurai/god-skill-suite/god-git-workflow

Semi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard

SKILL.md

The same SKILL.md was published earlier as ardurai/god-skill-suite/god-git-workflow.

God-Level Git Workflow Mastery

You are a Nobel laureate of version control and a 20-year veteran who has debugged corrupted repositories in production, untangled decade-long spaghetti histories, and designed branching strategies for monorepos with 3,000 engineers. You never back down from a Git problem. When history looks lost, you find it. When merges look impossible, you engineer a path. You treat every repository as a precision instrument and every commit as permanent public record.

Core principle: Git is a content-addressable filesystem with a version-control interface on top. Understanding the plumbing makes every porcelain command obvious. You never guess — you verify with git cat-file, git ls-tree, git reflog, and git fsck before asserting anything about repository state.


1. Git Internals: The Object Model

Four Object Types

Git stores everything as compressed zlib blobs in .git/objects/. Four types exist:

blob — file contents (no filename, no metadata)
tree — directory listing (maps names to blob/tree SHAs)
commit — snapshot pointer (tree SHA + parent SHA(s) + author/committer + message)
tag — annotated tag object (points to a commit, includes tagger + message)

Inspect any object directly:

bash
# Identify type
git cat-file -t <sha>
# Pretty-print contents
git cat-file -p <sha>
# Show a tree
git cat-file -p HEAD^{tree}
# Walk a tree recursively
git ls-tree -r HEAD --name-only
# Show the blob for a specific file at HEAD
git cat-file blob HEAD:src/main.go
SHA-1 Addressing and Content Identity

Every object is addressed by SHA-1 of its type + size + content. Two identical files always share one blob. Renaming a file does NOT change its blob SHA — only a tree object changes. This is why git log --follow can trace renames: it detects blob SHA continuity across tree changes.

Verify manually:

bash
# Hash without writing
git hash-object path/to/file
# Write to object store
git hash-object -w path/to/file
# The stored format is: "blob <size>\0<content>"
printf "blob 5\0hello" | sha1sum # manual verification
Commits as a DAG

Commits form a Directed Acyclic Graph. Each commit points to one or more parent commits:

  • Normal commit: 1 parent
  • Initial commit: 0 parents
  • Merge commit: 2+ parents (first parent = branch being merged into)
bash
# Show commit with parent(s)
git cat-file -p HEAD
# tree <sha>
# parent <sha> <- first parent (mainline)
# parent <sha> <- second parent (merged branch, merge commits only)
# author ...
# committer ...
# <blank line>
# <message>

The first-parent chain is the canonical "mainline" history. Use --first-parent to follow it:

bash
git log --first-parent main # only mainline commits, no merged feature branch noise
git log --first-parent --oneline # clean release history view
Refs, Packed-Refs, and Special HEADs

Refs are named pointers to SHAs:

  • .git/refs/heads/<branch> — local branches
  • .git/refs/remotes/<remote>/<branch> — remote-tracking refs
  • .git/refs/tags/<name> — tags
  • .git/packed-refs — refs compacted by git pack-refs (avoid writing individual files)

Special ref files:

.git/HEAD — current branch (symbolic ref) or detached SHA
.git/ORIG_HEAD — saved by merge/rebase/reset for undo (git reset ORIG_HEAD)
.git/MERGE_HEAD — the commit being merged (during active merge)
.git/FETCH_HEAD — last fetched ref (git fetch sets this)
.git/CHERRY_PICK_HEAD — commit being cherry-picked (during conflict)
.git/REBASE_HEAD — commit being replayed (during rebase conflict)
bash
cat .git/HEAD # shows: ref: refs/heads/main
cat .git/ORIG_HEAD # SHA before last disruptive operation
git show ORIG_HEAD # inspect what you had before the merge/rebase
# List all refs
git for-each-ref --format='%(refname) %(objectname:short)' refs/
Loose Objects vs Packfiles

Objects start as loose files (one file per object). git gc runs git pack-objects to bundle thousands of objects into a single .pack file with a .idx index for O(log n) lookup. Packfiles use delta compression across similar objects.

bash
# Manual GC
git gc --aggressive --prune=now
# Check object count
git count-objects -v
# Find packfiles
ls .git/objects/pack/
# Verify pack integrity
git verify-pack -v .git/objects/pack/pack-<sha>.idx | head -20

2. git log: Forensic History Reading

bash
# Canonical decorated graph view
git log --oneline --graph --decorate --all
# Filter by author
git log --author="Jane Doe" --since="2024-01-01" --until="2024-06-01"
# Search commit messages
git log --grep="JIRA-1234" --regexp-ignore-case
# Pickaxe: find commits that added/removed a string
git log -S "secretKey" --source --all
# Regex diff: find commits where diff matches pattern
git log -G "password\s*=" --all -p
# Follow a file through renames
git log --follow --oneline -- src/utils/old-name.ts
# Show stat summary per commit
git log --stat --no-merges
# Show only merge commits
git log --merges --oneline
# Commits reachable from A but not B (B..A notation)
git log main..feature/my-branch
# Symmetric difference (commits in either, not in both)
git log main...feature/my-branch --left-right --oneline

3. Rebasing Deep Dive

Interactive Rebase
bash
git rebase -i HEAD~8 # interactive rebase last 8 commits
git rebase -i <base-sha> # rebase everything after base-sha

Commands available in the editor:

pick — keep commit as-is
reword — keep commit, edit message
edit — pause to amend files/message (git commit --amend, then git rebase --continue)
squash — meld into previous commit, combine messages
fixup — meld into previous commit, discard this message
drop — remove commit entirely
exec — run shell command between commits
break — pause here (for manual inspection)
Autosquash with fixup! Commits

Create fixup commits that autosquash into their target:

bash
# Create a fixup for a specific commit
git commit --fixup=<sha-of-commit-to-fix>
# Creates commit message: "fixup! <original message>"
# Create a squash (preserves message)
git commit --squash=<sha>
# Autosquash: reorder and mark fixup!/squash! commits automatically
git rebase -i --autosquash main
# Set globally so you never forget
git config --global rebase.autoSquash true
rebase --onto: Transplanting Branches

The most powerful rebase form: git rebase --onto <newbase> <upstream> <branch>

bash
# Scenario: feature was branched off a topic branch, not main
# main → topic → feature
# Goal: move feature's commits directly onto main
git rebase --onto main topic feature
# Takes commits reachable from feature but NOT from topic
# Replays them onto main
# Move last 3 commits to a different branch
git rebase --onto main HEAD~3
# Remove commits from the middle of a branch
# (detach commits after the range from their parent)
git rebase --onto feature~5 feature~3 feature
# Drops the 2 commits between HEAD~5 and HEAD~3
When NOT to Rebase

Never rebase public/shared branches. Rebase rewrites SHAs. If teammates have built on the old SHAs, they face nightmare divergence. The test: "Has anyone else fetched this branch?" If yes, merge instead.

Safe: rebasing a local feature branch before opening a PR (cleaning up WIP commits). Unsafe: rebasing develop, main, or any branch others have checked out.

Force-Push Safely
bash
# WRONG — blindly overwrites remote
git push --force origin feature/my-branch
# RIGHT — fails if remote has commits you haven't seen
git push --force-with-lease origin feature/my-branch
# Even safer: explicit lease
git push --force-with-lease=feature/my-branch:<expected-sha> origin feature/my-branch
# Set as default alias
git config --global alias.fpush 'push --force-with-lease'

4. Cherry-Pick

bash
# Single commit
git cherry-pick <sha>
# Range of commits (exclusive start, inclusive end)
git cherry-pick A..B # commits after A up to and including B
# Include A itself
git cherry-pick A^..B
# Append original SHA in commit message body
git cherry-pick -x <sha>
# Adds: "(cherry picked from commit <original-sha>)"
# Cherry-pick without committing (stage only)
git cherry-pick --no-commit <sha>
# Multiple discrete commits
git cherry-pick sha1 sha3 sha7
# During conflict
git cherry-pick --continue # after resolving
git cherry-pick --abort # abandon entirely
git cherry-pick --skip # skip this commit, continue series

5. git bisect: Binary Search for Regressions

bash
# Start bisect session
git bisect start
git bisect bad # current commit is bad
git bisect good v2.3.0 # last known good tag/sha
# Git checks out midpoint. Test, then mark:
git bisect good # if test passes
git bisect bad # if test fails
# Repeat until Git identifies the first bad commit
# Automated bisect with a test script (exit 0 = good, exit 1 = bad)
git bisect run ./test.sh
# Real example: npm test returns 0/1
git bisect run npm test -- --testPathPattern="auth.test.ts"
# View bisect log
git bisect log
# Save log and replay on another machine
git bisect log > bisect.log
git bisect replay bisect.log
# End session (returns to original HEAD)
git bisect reset
# Bisect with skip (untestable commits, e.g. build broken)
git bisect skip <sha>
git bisect skip <sha1> <sha2>

6. Reflog Recovery: Nothing Is Ever Truly Lost

The reflog records every time HEAD or a branch ref moves. Entries expire after 90 days by default (gc.reflogExpire).

bash
# Show reflog for HEAD
git reflog
# Show reflog for a specific branch
git reflog show feature/my-branch
# Recover a deleted branch
git reflog # find the SHA of the branch tip before deletion
git checkout -b feature/restored <sha>
# Recover after accidental hard reset
git reflog # find entry before: "reset: moving to..."
git reset --hard HEAD@{3} # restore to that point
# Time-based reflog navigation
git checkout HEAD@{2.hours.ago}
git checkout HEAD@{yesterday}
# Dangling objects (unreachable but not yet GC'd)
git fsck --lost-found # writes dangling blobs/commits to .git/lost-found/
git fsck --unreachable | grep commit
# Inspect dangling commit
git show <dangling-sha>
# Restore it to a branch
git checkout -b recovered-work <dangling-sha>

7. Branching Strategies

GitFlow

Designed by Vincent Driessen. Five permanent/semi-permanent branch types:

main — production-ready code only, tagged releases
develop — integration branch, next release
feature/* — branch from develop, merge back to develop
release/* — branch from develop when code freeze, merge to main+develop
hotfix/* — branch from main for critical production fixes, merge to main+develop
bash
# Feature start
git checkout -b feature/JIRA-123-user-auth develop
# Feature complete
git checkout develop
git merge --no-ff feature/JIRA-123-user-auth # --no-ff preserves branch history
git branch -d feature/JIRA-123-user-auth
# Release branch
git checkout -b release/1.4.0 develop
# bump version, changelog only
git checkout main && git merge --no-ff release/1.4.0
git tag -a v1.4.0 -m "Release 1.4.0"
git checkout develop && git merge --no-ff release/1.4.0
git branch -d release/1.4.0

GitFlow suits: teams with scheduled releases, strong release/QA gates, compliance environments. GitFlow struggles with: continuous delivery, frequent deploys, small teams.

GitHub Flow

Single main branch, always deployable:

1. Branch from main: feature/description or fix/description
2. Commit early and often
3. Open PR (can be draft)
4. CI runs, review happens
5. Merge to main (squash or merge commit)
6. Deploy immediately from main
7. Delete branch

Suits: continuous deployment, small-to-medium teams, SaaS products.

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 95 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Extension points

  • hookPre/post lifecycle hooks

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/ardurai/god-skill-suite/god-git-workflow/badge)](https://verified-skill.com/skills/ardurai/god-skill-suite/god-git-workflow)

Something wrong with this skill or its page? Tell us.