Token导航 LogoToken导航

Agent Skill · 研究检索

git-advanced(git 高级)

git-advanced 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

git-advanced 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为需要联网;许可证为 MIT,第三方扫描有提醒项,按安装量在研究检索类的 73,674 个 Skill 里排第 55,093。

总安装 490周安装 20GitHub Stars 8下载 158核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
MIT

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:git-advanced(git 高级)
来源仓库:https://github.com/vamseeachanta/workspace-hub
仓库路径:skills/git-advanced
安装命令:
npx skills add https://github.com/vamseeachanta/workspace-hub --skill git-advanced
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/vamseeachanta/workspace-hub --skill git-advanced

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

git-advanced 用于查找、检索和筛选相关信息。适合在 Codex、Claude、Cursor、Gemini CLI 中根据关键词或任务场景快速定位候选结果。通过 npx skills add 命令从指定仓库安装,需结合原始 README 确认具体用法。

安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。当前暂无更多细节,建议参考来源仓库了解具体实现方式。

来源仓库内路径:skills/git-advanced

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/vamseeachanta/workspace-hub --skill git-advanc…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要需要联网,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

git-advanced 怎么安装?

在终端执行 npx skills add https://github.com/vamseeachanta/workspace-hub --skill git-advanced。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

git-advanced 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

git-advanced 需要什么权限?

权限级别是需要联网。该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

git-advanced 是免费的吗?

来源标注的许可证是 MIT。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

git-advanced 用的人多吗?

公开数据是累计安装 490 次,近一周安装 20 次,下载 158 次,GitHub 8 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

git-advanced 安全吗?

第三方扫描有提醒项,说明存在需要人工确认的行为。安装前请打开源码看清它读了什么、联网到哪里。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 3 个目录同时收录,说明这个 Skill 流传比较广。
  • 许可证明确为 MIT,商用和分发边界好判断。

先想清楚的地方

  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
git-advanced

git 高级 · 本页

4908需要联网MIT有提醒

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Git Advanced Skill

Master advanced git workflows for efficient version control. This skill covers interactive rebase, worktrees, bisect, rerere, reflog, hooks, and patterns for monorepos and submodules.

When to Use This Skill

USE when:

  • Managing complex branch strategies
  • Working on multiple features simultaneously
  • Hunting down bugs with bisect
  • Maintaining clean commit history
  • Setting up team workflows with hooks
  • Managing multi-repo dependencies
  • Recovering from git mistakes

DON'T USE when:

  • Simple linear development (basic git suffices)
  • Solo projects with simple history
  • When team isn't familiar with advanced git
  • Time-critical fixes (use simple commits)

Prerequisites

Installation

Git Configuration:

# Verify git version (2.23+ recommended)
git --version

# Global configuration
git config --global user.name "Your Name"
git config --global user.email "your.email@example.com"

# Recommended settings
git config --global init.defaultBranch main
git config --global pull.rebase true
git config --global push.autoSetupRemote true
git config --global rerere.enabled true
git config --global core.autocrlf input
git config --global core.editor "vim"

# Better diff
git config --global diff.algorithm histogram
git config --global merge.conflictStyle diff3

GitHub CLI (optional):

# macOS
brew install gh

# Linux
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
sudo apt update
sudo apt install gh

# Authenticate
gh auth login

Pre-commit (for hooks):

# Install pre-commit
pip install pre-commit

# Or with homebrew
brew install pre-commit

Core Capabilities

1. Interactive Rebase

Basic Interactive Rebase:

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

# Rebase onto main
git rebase -i main

# Rebase from specific commit
git rebase -i abc123^

Interactive Rebase Commands:

pick   abc123 First commit     # Use commit as-is
reword def456 Second commit    # Edit commit message
edit   ghi789 Third commit     # Stop to amend
squash jkl012 Fourth commit    # Combine with previous
fixup  mno345 Fifth commit     # Combine, discard message
drop   pqr678 Sixth commit     # Remove commit

Common Rebase Workflows:

# Squash all commits into one
git rebase -i main
# Change all but first 'pick' to 'squash'

# Reorder commits
git rebase -i HEAD~3
# Rearrange the pick lines

# Split a commit
git rebase -i HEAD~3
# Change 'pick' to 'edit' on target commit
git reset HEAD^
git add -p  # Add pieces
git commit -m "First part"
git add .
git commit -m "Second part"
git rebase --continue

# Edit commit message
git rebase -i HEAD~3
# Change 'pick' to 'reword'

Autosquash Pattern:

# Create fixup commit
git commit --fixup=abc123

# Create squash commit
git commit --squash=abc123

# Apply autosquash
git rebase -i --autosquash main

# Enable autosquash by default
git config --global rebase.autosquash true

2. Git Worktrees

Basic Worktree Usage:

# List worktrees
git worktree list

# Add worktree for existing branch
git worktree add ../feature-branch feature/new-feature

# Add worktree with new branch
git worktree add -b hotfix/urgent ../hotfix-urgent main

# Remove worktree
git worktree remove ../feature-branch

# Prune stale worktrees
git worktree prune

Worktree Workflow:

# Project structure
workspace/
├── main/           # Main development
├── feature-auth/   # Feature branch
├── hotfix-critical/# Hotfix branch
└── experiment/     # Experimental work

# Setup
cd main
git worktree add ../feature-auth feature/authentication
git worktree add ../hotfix-critical -b hotfix/critical-bug
git worktree add ../experiment -b experiment/new-approach

# Work on feature
cd ../feature-auth
# make changes...
git commit -am "Add authentication"

# Quick switch to fix bug
cd ../hotfix-critical
# fix bug...
git commit -am "Fix critical bug"
git push

# Back to feature
cd ../feature-auth

Worktree Helper Script:

#!/bin/bash
# scripts/worktree.sh
# ABOUTME: Git worktree management helper
# ABOUTME: Simplifies creating and managing worktrees

set -e

WORKTREE_BASE="${WORKTREE_BASE:-$(dirname $(git rev-parse --git-dir))}"

case "$1" in
    add)
        BRANCH="$2"
        DIR="${3:-$WORKTREE_BASE/../$(echo $BRANCH | tr '/' '-')}"
        if git show-ref --verify --quiet "refs/heads/$BRANCH"; then
            git worktree add "$DIR" "$BRANCH"
        else
            git worktree add -b "$BRANCH" "$DIR"
        fi
        echo "Created worktree at: $DIR"
        ;;
    remove)
        git worktree remove "$2"
        ;;
    list)
        git worktree list
        ;;
    *)
        echo "Usage: $0 {add|remove|list} [branch] [directory]"
        exit 1
        ;;
esac

3. Git Bisect

Basic Bisect:

# Start bisect
git bisect start

# Mark current version as bad
git bisect bad

# Mark known good commit
git bisect good v1.0.0

# Git checks out a commit - test it
# If bad:
git bisect bad
# If good:
git bisect good

# Continue until found
# Git will show: "abc123 is the first bad commit"

# End bisect
git bisect reset

Automated Bisect:

# Create test script
cat > test-bug.sh << 'EOF'
#!/bin/bash
# Return 0 if good, non-zero if bad
npm test -- --grep "specific test"
EOF
chmod +x test-bug.sh

# Run automated bisect
git bisect start
git bisect bad HEAD
git bisect good v1.0.0
git bisect run ./test-bug.sh

# Git will find the bad commit automatically
git bisect reset

Bisect with Skip:

# If commit can't be tested (won't build)
git bisect skip

# Skip range of commits
git bisect skip abc123..def456

Bisect Log and Replay:

# Save bisect session
git bisect log > bisect.log

# Replay session
git bisect replay bisect.log

4. Git Rerere (Reuse Recorded Resolution)

Enable Rerere:

# Enable globally
git config --global rerere.enabled true

# Check status
git config --get rerere.enabled

Using Rerere:

# When you resolve a conflict, git records the resolution
git merge feature-branch
# Resolve conflicts...
git add .
git commit

# Next time same conflict occurs, git auto-applies resolution
git merge another-branch
# "Resolved 'file.txt' using previous resolution."

# If auto-resolution is wrong, forget it
git rerere forget path/to/file

Rerere Management:

# View recorded resolutions
ls .git/rr-cache/

# Clean old resolutions
git rerere gc

# Show diff of recorded resolution
git rerere diff

5. Git Reflog

Basic Reflog:

# Show reflog
git reflog

# Show reflog with dates
git reflog --date=relative

# Show reflog for specific ref
git reflog show feature-branch

# Output
# abc123 HEAD@{0}: commit: Latest commit
# def456 HEAD@{1}: checkout: moving from main to feature
# ghi789 HEAD@{2}: commit: Previous commit

Recovery with Reflog:

# Recover deleted branch
git reflog
# Find last commit of deleted branch: abc123
git checkout -b recovered-branch abc123

# Undo hard reset
git reflog
# Find state before reset: HEAD@{2}
git reset --hard HEAD@{2}

# Recover lost stash
git fsck --unreachable | grep commit
git show <commit-hash>
git stash apply <commit-hash>

# Recover from bad rebase
git reflog
# Find pre-rebase state: HEAD@{5}
git reset --hard HEAD@{5}

Reflog Expiration:

# Check expiration settings
git config --get gc.reflogexpire  # Default: 90 days
git config --get gc.reflogexpireunreachable  # Default: 30 days

# Extend reflog retention
git config --global gc.reflogexpire 180.days

6. Git Hooks

Available Hooks:

client-side:
  pre-commit      # Before commit message prompt
  prepare-commit-msg  # Edit default message
  commit-msg      # Validate commit message
  post-commit     # After commit completes
  pre-push        # Before push

server-side:
  pre-receive     # Before accepting push
  update          # Per-branch check
  post-receive    # After push completes

Pre-commit Hook Example:

#!/bin/bash
# .git/hooks/pre-commit
# ABOUTME: Pre-commit hook for code quality
# ABOUTME: Runs linting and tests before commit

set -e

echo "Running pre-commit checks..."

# Check for debug statements
if git diff --cached --name-only | xargs grep -l 'console.log\|debugger\|binding.pry' 2>/dev/null; then
    echo "ERROR: Debug statements found. Remove before committing."
    exit 1
fi

# Run linter
if [ -f "package.json" ] && grep -q '"lint"' package.json; then
    echo "Running linter..."
    npm run lint --quiet || exit 1
fi

# Run tests
if [ -f "package.json" ] && grep -q '"test"' package.json; then
    echo "Running tests..."
    npm test --quiet || exit 1
fi

echo "Pre-commit checks passed!"

Commit-msg Hook Example:

#!/bin/bash
# .git/hooks/commit-msg
# ABOUTME: Validates commit message format
# ABOUTME: Enforces conventional commits

COMMIT_MSG_FILE="$1"
COMMIT_MSG=$(cat "$COMMIT_MSG_FILE")

# Conventional commit pattern
PATTERN="^(feat|fix|docs|style|refactor|test|chore|perf|ci|build|revert)(\(.+\))?: .{1,50}"

if ! echo "$COMMIT_MSG" | grep -qE "$PATTERN"; then
    echo "ERROR: Invalid commit message format."
    echo ""
    echo "Expected format: <type>(<scope>): <subject>"
    echo "Types: feat, fix, docs, style, refactor, test, chore, perf, ci, build, revert"
    echo ""
    echo "Examples:"
    echo "  feat(auth): add login functionality"
    echo "  fix(api): handle null response"
    echo "  docs: update README"
    exit 1
fi

Pre-push Hook Example:

#!/bin/bash
# .git/hooks/pre-push
# ABOUTME: Pre-push hook for safety checks
# ABOUTME: Prevents pushing to protected branches

BRANCH=$(git rev-parse --abbrev-ref HEAD)
PROTECTED_BRANCHES="^(main|master|production)$"

if echo "$BRANCH" | grep -qE "$PROTECTED_BRANCHES"; then
    echo "ERROR: Direct push to $BRANCH is not allowed."
    echo "Please create a pull request instead."
    exit 1
fi

# Run full test suite before push
echo "Running tests before push..."
npm test || exit 1

echo "Pre-push checks passed!"

Using pre-commit Framework:

# .pre-commit-config.yaml
repos:
  - repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v4.5.0
    hooks:
      - id: trailing-whitespace
      - id: end-of-file-fixer
      - id: check-yaml
      - id: check-json
      - id: check-merge-conflict
      - id: detect-private-key

  - repo: https://github.com/psf/black
    rev: 24.1.0
    hooks:
      - id: black

  - repo: https://github.com/pycqa/flake8
    rev: 7.0.0
    hooks:
      - id: flake8

  - repo: local
    hooks:
      - id: run-tests
        name: Run tests
        entry: npm test
        language: system
        pass_filenames: false
        always_run: true

Install pre-commit hooks:

# Install pre-commit
pip install pre-commit

# Install hooks
pre-commit install

# Install commit-msg hook
pre-commit install --hook-type commit-msg

# Run manually
pre-commit run --all-files

7. Git Aliases

Useful Aliases:

# Add to ~/.gitconfig
git config --global alias.co checkout
git config --global alias.br branch
git config --global alias.ci commit
git config --global alias.st status
git config --global alias.unstage 'reset HEAD --'
git config --global alias.last 'log -1 HEAD'
git config --global alias.visual '!gitk'

Advanced Aliases:

# ~/.gitconfig
[alias]
    # Status
    st = status -sb
    ss = status

    # Branch operations
    br = branch
    bra = branch -a
    brd = branch -d
    brD = branch -D

    # Checkout
    co = checkout
    cob = checkout -b
    com = checkout main

    # Commit
    ci = commit
    cia = commit --amend
    ciane = commit --amend --no-edit
    wip = !git add -A && git commit -m 'WIP'

    # Diff
    df = diff
    dfs = diff --staged
    dfw = diff --word-diff

    # Log
    lg = log --graph --oneline --decorate -20
    lga = log --graph --oneline --decorate --all
    ll = log --pretty=format:'%C(yellow)%h%C(reset) %s %C(blue)<%an>%C(reset) %C(green)(%cr)%C(reset)' -20
    hist = log --pretty=format:'%h %ad | %s%d [%an]' --graph --date=short

    # Stash
    sl = stash list
    sp = stash pop
    ss = stash save
    sd = stash drop

    # Remote
    pu = push
    puf = push --force-with-lease
    pl = pull
    plr = pull --rebase
    fe = fetch --all --prune

    # Rebase
    rb = rebase
    rbi = rebase -i
    rbc = rebase --continue
    rba = rebase --abort

    # Reset
    undo = reset --soft HEAD~1
    nuke = reset --hard HEAD

    # Clean
    clean-branches = !git branch --merged | grep -v '*' | xargs -n 1 git branch -d

    # Find
    find = !git ls-files | grep -i
    grep = grep -Ii

    # Utility
    aliases = !git config --get-regexp '^alias\\.' | sed 's/alias\\.\\([^ ]*\\) \\(.*\\)/\\1\\\t => \\2/' | sort
    contributors = shortlog -sn

8. Submodules

Basic Submodule Operations:

# Add submodule
git submodule add https://github.com/user/repo libs/repo

# Clone with submodules
git clone --recurse-submodules https://github.com/user/main-repo

# Initialize submodules after clone
git submodule init
git submodule update

# Or combined
git submodule update --init --recursive

# Update submodule to latest
cd libs/repo
git checkout main
git pull
cd ../..
git add libs/repo
git commit -m "Update submodule"

# Update all submodules
git submodule update --remote

Submodule Configuration:

# Track specific branch
git config -f .gitmodules submodule.libs/repo.branch main

# Shallow clone submodules
git config -f .gitmodules submodule.libs/repo.shallow true

# Update strategy
git submodule update --remote --merge  # Merge changes
git submodule update --remote --rebase # Rebase changes

Submodule Workflow Script:

#!/bin/bash
# scripts/submodule-sync.sh
# ABOUTME: Synchronize all submodules
# ABOUTME: Updates submodules to latest remote commits

set -e

echo "Synchronizing submodules..."

# Initialize any new submodules
git submodule init

# Update all submodules to tracked branch
git submodule update --remote --merge

# Show status
git submodule status

echo "Submodules synchronized!"

9. Monorepo Patterns

Sparse Checkout:

# Enable sparse checkout
git sparse-checkout init

# Set patterns
git sparse-checkout set packages/app packages/shared

# Add more patterns
git sparse-checkout add docs

# Disable sparse checkout
git sparse-checkout disable

Working with Monorepos:

# Clone specific directory only
git clone --filter=blob:none --sparse https://github.com/user/monorepo
cd monorepo
git sparse-checkout set packages/my-package

# Shallow clone for faster checkout
git clone --depth 1 --filter=blob:none --sparse https://github.com/user/monorepo

# Partial clone (fetch objects on demand)
git clone --filter=blob:none https://github.com/user/monorepo

Monorepo Commit Strategy:

# Commit message with scope
git commit -m "feat(package-name): add feature X"

# Using conventional commits
feat(api): add new endpoint
fix(web): resolve routing issue
chore(deps): update dependencies
docs(shared): improve API documentation

Integration Examples

1. Complete.gitconfig

# ~/.gitconfig

[user]
    name = Your Name
    email = your.email@example.com

[core]
    editor = vim
    autocrlf = input
    pager = delta

[init]
    defaultBranch = main

[pull]
    rebase = true

[push]
    autoSetupRemote = true
    default = current

[fetch]
    prune = true
    pruneTags = true

[merge]
    conflictStyle = diff3
    ff = false

[rebase]
    autosquash = true
    autostash = true

[rerere]
    enabled = true

[diff]
    algorithm = histogram
    colorMoved = default

[status]
    showUntrackedFiles = all

[credential]
    helper = cache --timeout=3600

[alias]
    # Core aliases
    st = status -sb
    co = checkout
    br = branch
    ci = commit
    lg = log --graph --oneline --decorate -20

    # Workflow aliases
    undo = reset --soft HEAD~1
    wip = !git add -A && git commit -m 'WIP'
    sync = !git fetch --all --prune && git pull --rebase

    # Branch cleanup
    cleanup = !git branch --merged main | grep -v '^[ *]*main$' | xargs git branch -d

[delta]
    navigate = true
    side-by-side = true
    line-numbers = true

[interactive]
    diffFilter = delta --color-only

2. GitHub Workflow with Hooks

# .github/workflows/pr-check.yml
name: PR Checks

on:
  pull_request:
    branches: [main]

jobs:
  validate:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0

      - name: Validate commit messages
        run: |
          COMMITS=$(git log --format="%s" origin/main..HEAD)
          PATTERN="^(feat|fix|docs|style|refactor|test|chore)(\(.+\))?: .+"
          while IFS= read -r commit; do
            if ! echo "$commit" | grep -qE "$PATTERN"; then
              echo "Invalid commit message: $commit"
              exit 1
            fi
          done <<< "$COMMITS"

      - name: Check for merge commits
        run: |
          MERGE_COMMITS=$(git log --merges origin/main..HEAD --oneline)
          if [ -n "$MERGE_COMMITS" ]; then
            echo "Merge commits found. Please rebase instead."
            echo "$MERGE_COMMITS"
            exit 1
          fi

      - name: Run tests
        run: npm test

3. Git Flow Helper Functions

# Add to ~/.bashrc

# Start feature
gf-start() {
    local feature="$1"
    git checkout main
    git pull
    git checkout -b "feature/$feature"
}

# Finish feature
gf-finish() {
    local branch=$(git rev-parse --abbrev-ref HEAD)
    git checkout main
    git pull
    git merge --no-ff "$branch"
    git branch -d "$branch"
}

# Start hotfix
gh-start() {
    local hotfix="$1"
    git checkout main
    git pull
    git checkout -b "hotfix/$hotfix"
}

# Sync branch with main
gsync() {
    local branch=$(git rev-parse --abbrev-ref HEAD)
    git fetch origin main:main
    git rebase main
}

Best Practices

1. Commit History

# Write good commit messages
git commit -m "feat(auth): add OAuth2 support

- Add Google OAuth provider
- Implement token refresh logic
- Add user profile sync

Closes #123"

# Keep commits atomic
# One logical change per commit

# Use conventional commits
# feat: new feature
# fix: bug fix
# docs: documentation
# style: formatting
# refactor: code restructure
# test: add tests
# chore: maintenance

2. Branch Strategy

# Feature branches from main
git checkout -b feature/add-auth main

# Hotfix branches from main
git checkout -b hotfix/fix-login main

# Keep branches short-lived
# Merge frequently

# Delete merged branches
git branch -d feature/add-auth

3. Rebase vs Merge

# Use rebase for:
# - Cleaning up local commits
# - Updating feature branch from main
git rebase main

# Use merge for:
# - Integrating feature into main
# - Preserving branch history
git merge --no-ff feature/add-auth

Troubleshooting

Common Issues

Accidental commit to wrong branch:

# Move commit to new branch
git branch new-branch
git reset --hard HEAD~1
git checkout new-branch

Undo merge:

# If not pushed
git reset --hard HEAD~1

# If pushed
git revert -m 1 <merge-commit>

Lost changes after checkout:

# Check reflog
git reflog

# Recover from reflog
git checkout HEAD@{2}

Resolve rebase conflicts:

# During rebase conflict
git status
# Edit conflicted files
git add <resolved-files>
git rebase --continue

# Abort if needed
git rebase --abort

Clean up after failed rebase:

git rebase --abort
# Or
git reflog
git reset --hard HEAD@{n}

Version History

  • 1.0.0 (2026-01-17): Initial release

- Interactive rebase patterns - Git worktrees for parallel development - Bisect for bug hunting - Rerere and reflog for recovery - Hooks and custom commands - Submodules and monorepo patterns


Use this skill to master advanced git workflows and maintain clean, professional version control!

平台分布

Claude Code

29.01%
按下载量换算46

windsurf

25.23%
按下载量换算40

trae

19.16%
按下载量换算30

OpenCode

12.21%
按下载量换算19

Cursor

7.56%
按下载量换算12

Codex

3.69%
按下载量换算6

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。

继续浏览同类 Skills