Advanced Git Workflows

Software development skill, available on Zeplik

Advanced Git Workflows is a ready-to-run software development skill on Zeplik. Use for advanced Git surgery: interactive rebase, cherry-pick, bisect, reflog recovery, and history cleanup before merging. Ask in plain language and Zeplik applies the skill's method for you inside the conversation, on whichever AI model you prefer.

The Advanced Git Workflows skill loads automatically when your request matches it, or you can invoke it directly by typing /git-advanced-workflows in any chat. It works with attachments, connectors, and any model that supports the task, so you get the same expert method every time without setting anything up.

What the Advanced Git Workflows skill can do

Try these prompts on Zeplik

Pick a prompt to open it in the Zeplik app. If you are not signed in yet, your prompt is waiting for you the moment you do.

How the Advanced Git Workflows skill works

/git-advanced-workflows

Advanced Git techniques for clean history, cross-branch surgery, and recovery from any situation. The user describes their repo state or pastes git log/git status output; deliver exact command sequences with a safety branch step and an abort path for every risky operation. For working on multiple branches in parallel checkouts, use using-git-worktrees.

When to Use

  • Cleaning up commit history before merging
  • Applying specific commits across branches
  • Finding commits that introduced bugs
  • Recovering from Git mistakes or lost commits
  • Preparing clean PRs for review
  • Synchronizing diverged branches

Core Concepts

1. Interactive Rebase

Interactive rebase is the Swiss Army knife of Git history editing.

Common Operations:

  • pick: Keep commit as-is
  • reword: Change commit message
  • edit: Amend commit content
  • squash: Combine with previous commit
  • fixup: Like squash but discard message
  • drop: Remove commit entirely

Basic Usage:

# Rebase last 5 commits
git rebase -i HEAD~5

# Rebase all commits on current branch
git rebase -i $(git merge-base HEAD main)

# Rebase onto specific commit
git rebase -i abc123

2. Cherry-Picking

Apply specific commits from one branch to another without merging entire branches.

# Cherry-pick single commit
git cherry-pick abc123

# Cherry-pick range of commits (exclusive start)
git cherry-pick abc123..def456

# Cherry-pick without committing (stage changes only)
git cherry-pick -n abc123

# Cherry-pick and edit commit message
git cherry-pick -e abc123

3. Git Bisect

Binary search through commit history to find the commit that introduced a bug.

# Start bisect
git bisect start

# Mark current commit as bad
git bisect bad

# Mark known good commit
git bisect good v1.0.0

# Git will checkout middle commit - test it
# Then mark as good or bad
git bisect good  # or: git bisect bad

# When done
git bisect reset

Automated Bisect:

# Use script to test automatically
git bisect start HEAD v1.0.0
git bisect run ./test.sh

# test.sh should exit 0 for good, 1-127 (except 125) for bad

4. Reflog

Your safety net -- tracks all ref movements, even deleted commits.

# View reflog
git reflog

# View reflog for specific branch
git reflog show feature/branch

# Restore deleted commit
git reflog
# Find commit hash
git checkout abc123
git branch recovered-branch

# Restore deleted branch
git reflog
git branch deleted-branch abc123

Best Practices

  1. Always Use --force-with-lease: Safer than --force, prevents overwriting others' work
  2. Rebase Only Local Commits: Don't rebase commits that have been pushed and shared
  3. Atomic Commits: Each commit should be a single logical change
  4. Test Before Force Push: Ensure history rewrite didn't break anything
  5. Keep Reflog Aware: Reflog is your safety net for 90 days
  6. Branch Before Risky Operations: Create backup branch before complex rebases
# Safe force push
git push --force-with-lease origin feature/branch

# Create backup before risky operation
git branch backup-branch
git rebase -i main
# If something goes wrong
git reset --hard backup-branch

Common Pitfalls

  • Rebasing Public Branches: Causes history conflicts for collaborators
  • Force Pushing Without Lease: Can overwrite teammate's work
  • Losing Work in Rebase: Resolve conflicts carefully, test after rebase
  • Not Backing Up Before Experiment: Always create safety branch
  • Bisect on Dirty Working Directory: Commit or stash before bisecting

Recovery Commands

# Abort operations in progress
git rebase --abort
git merge --abort
git cherry-pick --abort
git bisect reset

# Restore file to version from specific commit
git restore --source=abc123 path/to/file

# Undo last commit but keep changes
git reset --soft HEAD^

# Undo last commit and discard changes
git reset --hard HEAD^

# Recover deleted branch (within 90 days)
git reflog
git branch recovered-branch abc123

Detailed Patterns and Worked Examples

Extended scenarios (splitting commits, autosquash workflows, rerere, filter-repo notes) live in references/details.md. Read that file when the navigation tier above is insufficient.

Usage

/git-advanced-workflows $ARGUMENTS

How to use the Advanced Git Workflows skill

  1. Sign in to Zeplik

    Create a free Zeplik account or sign in. New accounts start with free credits, so you can try the Advanced Git Workflows skill right away.

  2. Describe your software development task

    Ask in plain language, or type /git-advanced-workflows to invoke the skill directly. Zeplik recognizes the Advanced Git Workflows skill and applies its method.

  3. Review and refine the result

    Zeplik returns a clear, structured answer. Ask follow-ups in the same chat to refine it or take the next step.

Source and credit

Author
wshobson
License
MIT

Adapted from the open-source wshobson/agents project and tuned to run natively on Zeplik. View source on GitHub.

Frequently asked questions

What is the Advanced Git Workflows skill?
Advanced Git Workflows is a ready-to-run software development skill on Zeplik. Use for advanced Git surgery: interactive rebase, cherry-pick, bisect, reflog recovery, and history cleanup before merging. Ask in plain language and Zeplik applies the skill's method for you inside the conversation, on whichever AI model you prefer.
How do I use Advanced Git Workflows on Zeplik?
Sign in to Zeplik and ask in plain language, or type /git-advanced-workflows in any chat to invoke it directly. The skill applies its method and returns a result you can refine in the same conversation.
Which AI model does the Advanced Git Workflows skill use?
Any model you choose. Zeplik works across every model in one chat, so the Advanced Git Workflows skill runs on your preferred model for the task.
Where does the Advanced Git Workflows skill come from?
The Advanced Git Workflows skill is adapted from the open-source wshobson/agents project (MIT) and tuned to run natively on Zeplik. The original source is linked on this page.
How much does the Advanced Git Workflows skill cost?
Using the skill is free to start. You only spend Zeplik credits when the assistant runs, and new accounts begin with free credits.

Related software development skills

More on Zeplik

Try Advanced Git Workflows on Zeplik

Every model, one chat. Bring the Advanced Git Workflows skill into your next conversation and let the assistant do the work.

Browse all skills
Advanced Git Workflows - Software development skill for Zeplik AI | Zeplik Chat