gitadvanced
Installation
Review the source and dependencies with a prompt. A package is available to download.
Install with an AI assistant
Copy the prompt so your assistant can review the pinned revision and dependencies first.
View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "gitadvanced" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-f48e969d9e5e04bbf2501e2467670aae4bdbadeee246a41b8e7c62f9b38c63c3. Verify the upstream source and version against https://skillhub.cn/skills/user_3c6cb52e/git-advanced-b50u before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.
Source and setup
skillhub.cn
Setup guidance pending
See the original source for supported tools, dependencies, and permissions.
Installation test pending
Git Advanced dedicated skill to assist AI Agents in efficiently completing tasks related to advanced Git operations.
Introduction source: third_party · user_3c6cb52e · 1.0.0 Reference
SkillPi interpretation
- Tasks
- Worktrees let you work on multiple branches simultaneously without stashing or committing WIP. Each worktree has its own working directory but shares the same `.git` repository.
- Audience
- Not specified in the source documentation.
- Inputs and outputs
- Not specified in the source documentation.
- Software, accounts and paid services
- Not specified in the source documentation.
- Limits and differences
- Not specified in the source documentation.
- Testing
- Not tested
Browse files
Frontmatter
name: Gitadvanced
slug: git-advanced
version: 1.0.0
displayName: Gitadvanced
description: >
GitAdvanced专用技能,帮助AI Agent高效完成相关任务。
summary: "GitAdvanced专用技能,帮助AI Agent高效完成相关任务。"
license: MIT
category: 开发者工具
framework:
- Claude Code
- Codex
- Hermes Agent
- OpenClaw
- QClaw
- WorkBuddy
platform: multi-platform
homepage: "https://github.com/1991513ccie-png"
repository: "https://github.com/1991513ccie-png"Git Advanced
Worktrees
# Create a worktree for a feature branch (avoids stashing)
git worktree add ../feature-auth feature/auth
# Create a worktree with a new branch
git worktree add ../hotfix-123 -b hotfix/123 origin/main
# List all worktrees
git worktree list
# Remove a worktree after merging
git worktree remove ../feature-auth
Worktrees let you work on multiple branches simultaneously without stashing or committing WIP. Each worktree has its own working directory but shares the same .git repository.
Bisect
# Start bisect, mark current as bad and known good commit
git bisect start
git bisect bad HEAD
git bisect good v1.5.0
# Git checks out a midpoint commit. Test it, then mark:
git bisect good # if this commit works
git bisect bad # if this commit is broken
# Automate with a test script
git bisect start HEAD v1.5.0
git bisect run npm test
# When done, reset
git bisect reset
Bisect performs binary search across commits to find which commit introduced a bug. Automated bisect with run is the fastest approach.
Interactive Rebase
# Rebase last 5 commits interactively
git rebase -i HEAD~5
# Common operations in the editor:
# pick - keep commit as-is
# reword - change commit message
# edit - stop to amend the commit
# squash - merge into previous commit, keep both messages
# fixup - merge into previous commit, discard this message
# drop - remove the commit entirely
# Rebase feature branch onto latest main
git fetch origin
git rebase origin/main
# Continue after resolving conflicts
git rebase --continue
# Abort if things go wrong
git rebase --abort
Git Hooks
#!/bin/sh
# .git/hooks/pre-commit
# Run linter on staged files only
STAGED_FILES=$(git diff --cached --name-only --diff-filter=d | grep -E '\.(ts|tsx|js|jsx)$')
if [ -n "$STAGED_FILES" ]; then
npx eslint $STAGED_FILES --fix
git add $STAGED_FILES
fi
#!/bin/sh
# .git/hooks/commit-msg
# Enforce conventional commit format
COMMIT_MSG=$(cat "$1")
PATTERN="^(feat|fix|docs|style|refactor|test|chore)(\(.+\))?: .{1,72}$"
if ! echo "$COMMIT_MSG" | head -1 | grep -qE "$PATTERN"; then
echo "Error: Commit message must follow Conventional Commits format"
echo "Example: feat(auth): add OAuth2 login flow"
exit 1
fi
#!/bin/sh
# .git/hooks/pre-push
# Run tests before pushing
npm test
if [ $? -ne 0 ]; then
echo "Tests failed. Push aborted."
exit 1
fi
Recovery Techniques
# Undo last commit but keep changes staged
git reset --soft HEAD~1
# Recover a deleted branch using reflog
git reflog
git checkout -b recovered-branch HEAD@{3}
# Recover a file from a specific commit
git checkout abc1234 -- path/to/file.ts
# Find lost commits (dangling after reset or rebase)
git fsck --lost-found
git show <dangling-commit-sha>
# Undo a rebase
git reflog
git reset --hard HEAD@{5} # point before rebase started
Useful Aliases
# ~/.gitconfig
[alias]
lg = log --graph --oneline --decorate --all
st = status -sb
co = checkout
unstage = reset HEAD --
last = log -1 HEAD --stat
branches = branch -a --sort=-committerdate
stash-all = stash push --include-untracked
conflicts = diff --name-only --diff-filter=U
Anti-Patterns
- Force-pushing to shared branches without
--force-with-lease - Rebasing commits that have already been pushed and shared
- Committing large binary files without Git LFS
- Using
git add .without reviewinggit diff --staged - Not using
.gitignorefor build artifacts, dependencies, and secrets - Keeping long-lived feature branches instead of merging frequently
Checklist
- [ ] Worktrees used for parallel branch work instead of stashing
- [ ]
git bisect runautomates bug-finding with a test command - [ ] Interactive rebase cleans up commits before merging to main
- [ ] Pre-commit hooks run linting on staged files
- [ ] Commit message format enforced via commit-msg hook
- [ ]
--force-with-leaseused instead of--forcewhen force-pushing - [ ] Reflog consulted before any destructive operation
- [ ]
.gitignorecovers build outputs, dependencies, and environment files
Current listing version
1.0.0
Safety and assessment details
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 提供 Git 高级功能实用指南,涵盖 worktrees、bisect、rebase 等核心场景
- 面向开发者解决实际痛点,实用价值高
Highlights
- 触发描述清晰明确,边界清晰
Highlights
- 结构清晰,分章节组织,每节有代码示例和说明
- frontmatter 完整,文档长度合理
Highlights
- 命令来源明确,参数正确,语法规范
- 包含错误处理建议和恢复技巧
The arithmetic mean of the first four original scores, rounded to a whole number.
Static text checks
100 / 100 · skillpi-20261123-no-r3-v1
No current rules matched the text.
This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.
Permissions and checks before use
Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.
-
Overwrite or clean a working tree
May replace uncommitted files or remove untracked files. Check git status, commit or back up changes, and confirm target files first.
Mentioned in main document · lines 144, 152 -
Install or fetch external dependencies
Use official sources and pin versions. Check install scripts in an isolated environment. This document check does not cover code downloaded later.
Mentioned in main document · lines 101
Domains or addresses referenced in the document
These addresses may be documentation links or examples, not an approved network allowlist. Verify actual destinations and outgoing data before use.
- github.com
Security rating and access scope
safe · Static evidence review; not a runtime safety guarantee.
Not specified in the source documentation.
Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.
User discussion
No verified reviews yet.