Token导航 LogoToken导航

Agent Skill · 运维和基础设施

git-advanced(git 高级)

git-advanced 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

git-advanced 是运维和基础设施类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为执行命令;许可证为 MIT,第三方扫描已通过,按安装量在运维和基础设施类的 2,449 个 Skill 里排第 303。

总安装 6,696周安装 279GitHub Stars 8下载 2,232核验 2026-05-01

安装说明

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

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/geoffjay/claude-plugins --skill git-advanced

这个 Skill 是做什么的

运维和基础设施类 Skill 处理部署、监控、日志和云资源,多数需要较高的执行权限。

git-advanced 提供高级 Git 操作功能,支持复杂的版本控制需求。适用于需要高级 Git 功能的开发者和运维人员使用。通过 npx skills add 命令从指定 GitHub 仓库安装并使用该技能。安装前需确认权限范围和维护状态,注意可能触发的联网或文件操作行为。

适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

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

上手步骤

4 步
  1. 1

    确认自己的宿主工具

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

  2. 2

    拿到安装命令

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

  3. 3

    安装后重启宿主

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

  4. 4

    按最小权限试用

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

常见问题

6 条

git-advanced 怎么安装?

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

git-advanced 支持哪些 AI 工具?

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

git-advanced 需要什么权限?

权限级别是执行命令。安装流程涉及命令执行,可能通过 npx skills add https://github.com/geoffjay/claude-plugins --skill git-advanced;npx skills add geoffjay/claude-plugins --skill "git-advanced" 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

git-advanced 是免费的吗?

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

git-advanced 用的人多吗?

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

git-advanced 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

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

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 3 个目录同时收录,说明这个 Skill 流传比较广。
  • 许可证明确为 MIT,商用和分发边界好判断。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 需要执行命令,装到常用环境前要先评估影响面。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理运维和基础设施类任务、又不想每次都手写提示词的人。
  • 需要许可证清楚、并且有第三方扫描结果的团队项目。

不太适合

  • 不能接受 Skill 在你机器上执行命令的人。
  • 需要厂商级技术支持和 SLA 的生产系统。

运维和基础设施类 Skill 对比

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

头脑风暴 · Codex、Claude

3,148,776173,131操作浏览器MIT通过
copywriting

文案写作 · Codex、Claude

1,996,72425,583需要联网MIT通过
openclaw-secure-linux-cloud

OpenClaw secure linux cloud 命令行 · Codex、Claude

1,853,08840接触敏感数据未明确未通过
xget

xget 命令行 · Codex、Claude

1,799,28040执行命令未明确未通过
requesting-code-review

代码审查请求 · Codex、Claude

1,590,144173,103权限未标注MIT通过
git-advanced

git 高级 · 本页

6,6968执行命令MIT通过

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

SKILL.md 原文

Git Advanced Operations Skill

This skill provides comprehensive guidance on advanced git operations, sophisticated rebase strategies, commit surgery techniques, and complex history manipulation for experienced git users.

When to Use

Activate this skill when:

  • Performing complex interactive rebases
  • Rewriting commit history
  • Splitting or combining commits
  • Advanced merge strategies
  • Cherry-picking across branches
  • Commit message editing in history
  • Author information changes
  • Complex conflict resolution

Interactive Rebase Strategies

Basic Interactive Rebase

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

# Rebase from specific commit
git rebase -i abc123^

# Rebase entire branch
git rebase -i main

Rebase Commands

# Interactive rebase editor commands:
# p, pick = use commit
# r, reword = use commit, but edit commit message
# e, edit = use commit, but stop for amending
# s, squash = use commit, but meld into previous commit
# f, fixup = like squash, but discard commit message
# x, exec = run command (the rest of the line) using shell
# d, drop = remove commit

Squashing Commits

# Example: Squash last 3 commits
git rebase -i HEAD~3

# In editor:
pick abc123 feat: add user authentication
squash def456 fix: resolve login bug
squash ghi789 style: format code

# Squash all commits in feature branch
git rebase -i main
# Mark all except first as 'squash'

Fixup Workflow

# Create fixup commit automatically
git commit --fixup=abc123

# Autosquash during rebase
git rebase -i --autosquash main

# Set autosquash as default
git config --global rebase.autosquash true

# Example workflow:
git log --oneline -5
# abc123 feat: add authentication
# def456 feat: add authorization
git commit --fixup=abc123
git rebase -i --autosquash HEAD~3

Reordering Commits

# Interactive rebase
git rebase -i HEAD~5

# In editor, change order:
pick def456 feat: add database migration
pick abc123 feat: add user model
pick ghi789 feat: add API endpoints

# Reorder by moving lines:
pick abc123 feat: add user model
pick def456 feat: add database migration
pick ghi789 feat: add API endpoints

Splitting Commits

# Start interactive rebase
git rebase -i HEAD~3

# Mark commit to split with 'edit'
edit abc123 feat: add user and role features

# When rebase stops:
git reset HEAD^

# Stage and commit parts separately
git add user.go
git commit -m "feat: add user management"

git add role.go
git commit -m "feat: add role management"

# Continue rebase
git rebase --continue

Editing Old Commits

# Start interactive rebase
git rebase -i HEAD~5

# Mark commit with 'edit'
edit abc123 feat: add authentication

# When rebase stops, make changes
git add modified-file.go
git commit --amend --no-edit

# Or change commit message
git commit --amend

# Continue rebase
git rebase --continue

Commit Surgery

Amending Commits

# Amend last commit (add changes)
git add forgotten-file.go
git commit --amend --no-edit

# Amend commit message
git commit --amend -m "fix: correct typo in feature"

# Amend author information
git commit --amend --author="John Doe <john@example.com>"

# Amend date
git commit --amend --date="2024-03-15 10:30:00"

Changing Commit Messages

# Change last commit message
git commit --amend

# Change older commit messages
git rebase -i HEAD~5
# Mark commits with 'reword'

# Change commit message without opening editor
git commit --amend -m "new message" --no-edit

Changing Multiple Authors

# Filter-branch (legacy method, use filter-repo instead)
git filter-branch --env-filter '
if [ "$GIT_COMMITTER_EMAIL" = "old@example.com" ]; then
    export GIT_COMMITTER_NAME="New Name"
    export GIT_COMMITTER_EMAIL="new@example.com"
fi
if [ "$GIT_AUTHOR_EMAIL" = "old@example.com" ]; then
    export GIT_AUTHOR_NAME="New Name"
    export GIT_AUTHOR_EMAIL="new@example.com"
fi
' --tag-name-filter cat -- --branches --tags

# Modern method with git-filter-repo
git filter-repo --email-callback '
    return email.replace(b"old@example.com", b"new@example.com")
'

Removing Files from History

# Remove file from all history
git filter-branch --tree-filter 'rm -f passwords.txt' HEAD

# Better performance with index-filter
git filter-branch --index-filter 'git rm --cached --ignore-unmatch passwords.txt' HEAD

# Modern method with git-filter-repo (recommended)
git filter-repo --path passwords.txt --invert-paths

# Remove large files
git filter-repo --strip-blobs-bigger-than 10M

BFG Repo-Cleaner

# Install BFG
# brew install bfg (macOS)
# apt-get install bfg (Ubuntu)

# Remove files by name
bfg --delete-files passwords.txt

# Remove large files
bfg --strip-blobs-bigger-than 50M

# Replace passwords in history
bfg --replace-text passwords.txt

# After BFG cleanup
git reflog expire --expire=now --all
git gc --prune=now --aggressive

Advanced Cherry-Picking

Basic Cherry-Pick

# Cherry-pick single commit
git cherry-pick abc123

# Cherry-pick multiple commits
git cherry-pick abc123 def456 ghi789

# Cherry-pick range of commits
git cherry-pick abc123..ghi789

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

Cherry-Pick with Conflicts

# When conflicts occur
git cherry-pick abc123
# CONFLICT: resolve conflicts

# After resolving conflicts
git add resolved-file.go
git cherry-pick --continue

# Or abort cherry-pick
git cherry-pick --abort

# Skip current commit
git cherry-pick --skip

Cherry-Pick Options

# Edit commit message during cherry-pick
git cherry-pick -e abc123

# Sign-off cherry-picked commit
git cherry-pick -s abc123

# Keep original author date
git cherry-pick --ff abc123

# Apply changes without commit attribution
git cherry-pick -n abc123
git commit --author="New Author <new@example.com>"

Mainline Selection for Merge Commits

# Cherry-pick merge commit (specify parent)
git cherry-pick -m 1 abc123

# -m 1 = use first parent (main branch)
# -m 2 = use second parent (merged branch)

# Example workflow:
git log --graph --oneline
#   *   abc123 Merge pull request #123
#   |\
#   | * def456 feat: feature commit
#   * | ghi789 fix: main branch commit

# To cherry-pick the merge keeping main branch changes:
git cherry-pick -m 1 abc123

Advanced Merging

Merge Strategies

# Recursive merge (default)
git merge -s recursive branch-name

# Ours (keep our changes on conflict)
git merge -s ours branch-name

# Theirs (keep their changes on conflict)
git merge -s theirs branch-name

# Octopus (merge 3+ branches)
git merge -s octopus branch1 branch2 branch3

# Subtree merge
git merge -s subtree branch-name

Merge Strategy Options

# Ours (resolve conflicts with our version)
git merge -X ours branch-name

# Theirs (resolve conflicts with their version)
git merge -X theirs branch-name

# Ignore whitespace
git merge -X ignore-space-change branch-name
git merge -X ignore-all-space branch-name

# Patience algorithm (better conflict detection)
git merge -X patience branch-name

# Renormalize line endings
git merge -X renormalize branch-name

Three-Way Merge

# Standard three-way merge
git merge feature-branch

# With custom merge message
git merge feature-branch -m "Merge feature: add authentication"

# No fast-forward (always create merge commit)
git merge --no-ff feature-branch

# Fast-forward only (fail if merge commit needed)
git merge --ff-only feature-branch

# Squash merge (combine all commits)
git merge --squash feature-branch
git commit -m "feat: add complete authentication system"

Advanced Conflict Resolution

Understanding Conflict Markers

<<<<<<< HEAD (Current Change)
int result = add(a, b);
=======
int sum = calculate(a, b);
>>>>>>> feature-branch (Incoming Change)

Conflict Resolution Tools

# Use mergetool
git mergetool

# Specify merge tool
git mergetool --tool=vimdiff
git mergetool --tool=meld
git mergetool --tool=kdiff3

# Configure default merge tool
git config --global merge.tool vimdiff
git config --global mergetool.vimdiff.cmd 'vimdiff "$LOCAL" "$MERGED" "$REMOTE"'

# Check out specific version
git checkout --ours file.go    # Keep our version
git checkout --theirs file.go  # Keep their version
git checkout --merge file.go   # Recreate conflict markers

Rerere (Reuse Recorded Resolution)

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

# Rerere will automatically resolve previously seen conflicts
git merge feature-branch
# Conflict occurs and is resolved
git add file.go
git commit

# Later, same conflict:
git merge another-branch
# Rerere automatically applies previous resolution

# View rerere cache
git rerere status
git rerere diff

# Clear rerere cache
git rerere forget file.go
git rerere clear

Interactive Staging

Partial File Staging

# Interactive staging
git add -p file.go

# Patch commands:
# y - stage this hunk
# n - do not stage this hunk
# q - quit (do not stage this and remaining hunks)
# a - stage this and all remaining hunks
# d - do not stage this and all remaining hunks
# s - split the current hunk into smaller hunks
# e - manually edit the current hunk

Interactive Add

# Interactive mode
git add -i

# Commands:
# 1: status       - show paths with changes
# 2: update       - stage paths
# 3: revert       - unstage paths
# 4: add untracked - stage untracked files
# 5: patch        - partial staging
# 6: diff         - show staged changes
# 7: quit         - exit

Partial Commits

# Stage part of file interactively
git add -p file.go

# Create commit with partial changes
git commit -m "feat: add validation logic"

# Stage remaining changes
git add file.go
git commit -m "feat: add error handling"

Advanced Reset Operations

Reset Modes

# Soft reset (keep changes staged)
git reset --soft HEAD~1

# Mixed reset (keep changes unstaged, default)
git reset --mixed HEAD~1
git reset HEAD~1

# Hard reset (discard all changes)
git reset --hard HEAD~1

# Reset to specific commit
git reset --hard abc123

Reset vs Revert

# Reset (rewrites history, use for local changes)
git reset --hard HEAD~3

# Revert (creates new commit, safe for shared history)
git revert HEAD
git revert HEAD~3
git revert abc123..def456

Advanced Branch Operations

Branch from Specific Commit

# Create branch from commit
git branch new-branch abc123
git checkout new-branch

# Or in one command
git checkout -b new-branch abc123

# Create branch from remote commit
git checkout -b local-branch origin/remote-branch

Orphan Branches

# Create orphan branch (no parent)
git checkout --orphan new-root
git rm -rf .

# Useful for gh-pages, documentation, etc.
echo "# Documentation" > README.md
git add README.md
git commit -m "docs: initialize documentation"

Branch Tracking

# Set upstream branch
git branch -u origin/main

# Push and set upstream
git push -u origin feature-branch

# Change upstream
git branch -u origin/develop

# View tracking information
git branch -vv

Advanced Stash Operations

Stash Specific Files

# Stash specific files
git stash push -m "WIP: feature work" file1.go file2.go

# Stash with pathspec
git stash push -p

# Stash untracked files
git stash -u

# Stash including ignored files
git stash -a

Stash to Branch

# Create branch from stash
git stash branch new-branch stash@{0}

# Creates new branch and applies stash
git stash branch feature-work

Partial Stash Application

# Apply specific files from stash
git checkout stash@{0} -- file.go

# Apply stash without dropping
git stash apply stash@{0}

# Apply and drop
git stash pop stash@{0}

Submodule Management

Advanced Submodule Operations

# Update submodule to specific commit
cd submodule-dir
git checkout abc123
cd ..
git add submodule-dir
git commit -m "chore: update submodule to version 1.2.3"

# Update all submodules to latest
git submodule update --remote --merge

# Update specific submodule
git submodule update --remote --merge path/to/submodule

# Run command in all submodules
git submodule foreach 'git checkout main'
git submodule foreach 'git pull'

# Clone with submodules at specific depth
git clone --recurse-submodules --depth 1 repo-url

Submodule to Subtree Migration

# Remove submodule
git submodule deinit path/to/submodule
git rm path/to/submodule
rm -rf .git/modules/path/to/submodule

# Add as subtree
git subtree add --prefix=path/to/submodule \
    https://github.com/user/repo.git main --squash

# Update subtree
git subtree pull --prefix=path/to/submodule \
    https://github.com/user/repo.git main --squash

Advanced Log and History

Custom Log Formatting

# One-line format with custom fields
git log --pretty=format:"%h - %an, %ar : %s"

# Full custom format
git log --pretty=format:"%C(yellow)%h%C(reset) %C(blue)%ad%C(reset) %C(green)%an%C(reset) %s" --date=short

# Aliases for common formats
git config --global alias.lg "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative"

Finding Lost Commits

# Find commits not in any branch
git log --all --oneline --no-walk --decorate $(git fsck --no-reflog | grep commit | cut -d' ' -f3)

# Find dangling commits
git fsck --lost-found

# Search commit messages
git log --all --grep="search term"

# Find commits by author
git log --author="John Doe"

# Find commits modifying specific code
git log -S "function_name"
git log -G "regex_pattern"

Bisect Automation

# Start bisect
git bisect start
git bisect bad HEAD
git bisect good abc123

# Automate bisect with script
git bisect run ./test.sh

# test.sh example:
#!/bin/bash
make && make test
exit $?

# Bisect will automatically find first bad commit

Best Practices

  1. Backup Before History Rewriting: Create backup branch before complex operations
  2. Never Rewrite Published History: Only rewrite local commits
  3. Communicate Rebases: Inform team when force-pushing
  4. Use Descriptive Commit Messages: Even during interactive rebase
  5. Test After Rebase: Ensure code still works after history changes
  6. Prefer Rebase for Local Branches: Keep history linear
  7. Use Merge for Shared Branches: Preserve complete history
  8. Sign Important Commits: Use GPG signing for releases
  9. Document Complex Operations: Leave comments for future reference
  10. Know When to Stop: Sometimes merge commits are clearer than rebased history

Resources

Additional guides and examples are available in the assets/ directory:

  • examples/ - Complex rebase and merge scenarios
  • scripts/ - Automation scripts for common operations
  • workflows/ - Advanced workflow patterns

See references/ directory for:

  • Git internals documentation
  • Advanced rebasing strategies
  • Filter-branch alternatives
  • Conflict resolution techniques

平台分布

Claude Code

26.78%
按下载量换算598

windsurf

25.68%
按下载量换算573

Gemini CLI

17.68%
按下载量换算395

OpenCode

13.84%
按下载量换算309

Antigravity

7.64%
按下载量换算171

Cursor

3.72%
按下载量换算83

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/geoffjay/claude-plugins --skill git-advanced;npx skills add geoffjay/claude-plugins --skill "git-advanced" 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

继续浏览同类 Skills