← 返回 Skills 市场
a2mus

Doro Git Essentials

作者 Mus Titou · GitHub ↗ · v1.0.0
cross-platform ✓ 安全检测通过
738
总下载
0
收藏
3
当前安装
1
版本数
在 OpenClaw 中安装
/install doro-git-essentials
功能描述
Essential Git commands and workflows for version control, branching, and collaboration.
使用说明 (SKILL.md)

Git Essentials

Essential Git commands for version control and collaboration.

Initial Setup

# Configure user
git config --global user.name "Your Name"
git config --global user.email "[email protected]"

# Initialize repository
git init

# Clone repository
git clone https://github.com/user/repo.git
git clone https://github.com/user/repo.git custom-name

Basic Workflow

Staging and committing

# Check status
git status

# Add files to staging
git add file.txt
git add .
git add -A  # All changes including deletions

# Commit changes
git commit -m "Commit message"

# Add and commit in one step
git commit -am "Message"

# Amend last commit
git commit --amend -m "New message"
git commit --amend --no-edit  # Keep message

Viewing changes

# Show unstaged changes
git diff

# Show staged changes
git diff --staged

# Show changes in specific file
git diff file.txt

# Show changes between commits
git diff commit1 commit2

Branching & Merging

Branch management

# List branches
git branch
git branch -a  # Include remote branches

# Create branch
git branch feature-name

# Switch branch
git checkout feature-name
git switch feature-name  # Modern alternative

# Create and switch
git checkout -b feature-name
git switch -c feature-name

# Delete branch
git branch -d branch-name
git branch -D branch-name  # Force delete

# Rename branch
git branch -m old-name new-name

Merging

# Merge branch into current
git merge feature-name

# Merge with no fast-forward
git merge --no-ff feature-name

# Abort merge
git merge --abort

# Show merge conflicts
git diff --name-only --diff-filter=U

Remote Operations

Managing remotes

# List remotes
git remote -v

# Add remote
git remote add origin https://github.com/user/repo.git

# Change remote URL
git remote set-url origin https://github.com/user/new-repo.git

# Remove remote
git remote remove origin

Syncing with remote

# Fetch from remote
git fetch origin

# Pull changes (fetch + merge)
git pull

# Pull with rebase
git pull --rebase

# Push changes
git push

# Push new branch
git push -u origin branch-name

# Force push (careful!)
git push --force-with-lease

History & Logs

Viewing history

# Show commit history
git log

# One line per commit
git log --oneline

# With graph
git log --graph --oneline --all

# Last N commits
git log -5

# Commits by author
git log --author="Name"

# Commits in date range
git log --since="2 weeks ago"
git log --until="2024-01-01"

# File history
git log -- file.txt

Searching history

# Search commit messages
git log --grep="bug fix"

# Search code changes
git log -S "function_name"

# Show who changed each line
git blame file.txt

# Find commit that introduced bug
git bisect start
git bisect bad
git bisect good commit-hash

Undoing Changes

Working directory

# Discard changes in file
git restore file.txt
git checkout -- file.txt  # Old way

# Discard all changes
git restore .

Staging area

# Unstage file
git restore --staged file.txt
git reset HEAD file.txt  # Old way

# Unstage all
git reset

Commits

# Undo last commit (keep changes)
git reset --soft HEAD~1

# Undo last commit (discard changes)
git reset --hard HEAD~1

# Revert commit (create new commit)
git revert commit-hash

# Reset to specific commit
git reset --hard commit-hash

Stashing

# Stash changes
git stash

# Stash with message
git stash save "Work in progress"

# List stashes
git stash list

# Apply latest stash
git stash apply

# Apply and remove stash
git stash pop

# Apply specific stash
git stash apply stash@{2}

# Delete stash
git stash drop stash@{0}

# Clear all stashes
git stash clear

Rebasing

# Rebase current branch
git rebase main

# Interactive rebase (last 3 commits)
git rebase -i HEAD~3

# Continue after resolving conflicts
git rebase --continue

# Skip current commit
git rebase --skip

# Abort rebase
git rebase --abort

Tags

# List tags
git tag

# Create lightweight tag
git tag v1.0.0

# Create annotated tag
git tag -a v1.0.0 -m "Version 1.0.0"

# Tag specific commit
git tag v1.0.0 commit-hash

# Push tag
git push origin v1.0.0

# Push all tags
git push --tags

# Delete tag
git tag -d v1.0.0
git push origin --delete v1.0.0

Advanced Operations

Cherry-pick

# Apply specific commit
git cherry-pick commit-hash

# Cherry-pick without committing
git cherry-pick -n commit-hash

Submodules

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

# Initialize submodules
git submodule init

# Update submodules
git submodule update

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

Clean

# Preview files to be deleted
git clean -n

# Delete untracked files
git clean -f

# Delete untracked files and directories
git clean -fd

# Include ignored files
git clean -fdx

Common Workflows

Feature branch workflow:

git checkout -b feature/new-feature
# Make changes
git add .
git commit -m "Add new feature"
git push -u origin feature/new-feature
# Create PR, then after merge:
git checkout main
git pull
git branch -d feature/new-feature

Hotfix workflow:

git checkout main
git pull
git checkout -b hotfix/critical-bug
# Fix bug
git commit -am "Fix critical bug"
git push -u origin hotfix/critical-bug
# After merge:
git checkout main && git pull

Syncing fork:

git remote add upstream https://github.com/original/repo.git
git fetch upstream
git checkout main
git merge upstream/main
git push origin main

Useful Aliases

Add to ~/.gitconfig:

[alias]
    st = status
    co = checkout
    br = branch
    ci = commit
    unstage = reset HEAD --
    last = log -1 HEAD
    visual = log --graph --oneline --all
    amend = commit --amend --no-edit

Tips

  • Commit often, perfect later (interactive rebase)
  • Write meaningful commit messages
  • Use .gitignore for files to exclude
  • Never force push to shared branches
  • Pull before starting work
  • Use feature branches, not main
  • Rebase feature branches before merging
  • Use --force-with-lease instead of --force

Common Issues

Undo accidental commit:

git reset --soft HEAD~1

Recover deleted branch:

git reflog
git checkout -b branch-name \x3Ccommit-hash>

Fix wrong commit message:

git commit --amend -m "Correct message"

Resolve merge conflicts:

# Edit files to resolve conflicts
git add resolved-files
git commit  # Or git merge --continue

Documentation

Official docs: https://git-scm.com/doc Pro Git book: https://git-scm.com/book Visual Git guide: https://marklodato.github.io/visual-git-guide/

安全使用建议
This skill is an offline instruction-only Git reference (no code to install, no external downloads, no credentials requested). It is coherent with its purpose. Before using it: (1) be aware many commands are destructive (git reset --hard, git push --force, git clean -fdx) and will alter or permanently remove local/remote data — run them only if you understand the effect; (2) git config --global writes to ~/.gitconfig (expected); (3) verify the publisher/owner if provenance matters — the embedded _meta.json differs from the registry metadata (slug/ownerId mismatch), which is a packaging inconsistency (not a behavioral risk here but worth confirming); (4) because the skill can be invoked by an agent, avoid allowing automated runs to execute destructive commands on repositories you care about.
功能分析
Type: OpenClaw Skill Name: doro-git-essentials Version: 1.0.0 The skill bundle 'doro-git-essentials' is a comprehensive guide to Git commands and workflows. All commands presented in SKILL.md are standard Git operations, and there is no evidence of data exfiltration, malicious execution, persistence mechanisms, or prompt injection attempts against the AI agent. The `_meta.json` file contains standard metadata. The content is purely instructional and aligns perfectly with its stated purpose of providing essential Git commands.
能力评估
Purpose & Capability
Name and description match the contents: the skill is a Git command reference and it only requires the 'git' binary. There are no unrelated credentials, binaries, or config paths requested.
Instruction Scope
SKILL.md is a straightforward Git guide. It instructs running commands that modify local state (~/.gitconfig via git config --global, working tree, commits, branches) and remote state (git push, git push --force, git remote set-url). These are expected for a Git guide but are potentially destructive; the skill does not try to read unrelated files or send data to external endpoints beyond standard git remotes.
Install Mechanism
No install spec and no code files — lowest-risk form. Note: registry metadata at the top of the package and the embedded _meta.json show different ownerId/slug values (registry: 'doro-git-essentials', ownerId kn7ervna...; _meta.json: slug 'git-essentials', ownerId kn7anq2d...), which is a minor inconsistency in metadata but does not affect behavior since there is no install step or external download.
Credentials
No environment variables, credentials, or config paths are requested. The SKILL.md does not reference secrets or access tokens. The only side-effects are standard git operations that use whatever repo/remotes the user provides.
Persistence & Privilege
always is false and the skill is user-invocable. It does not request permanent presence or modify other skills or system-wide settings. The only persistent change it suggests is modifying the user's Git config (~/.gitconfig), which is expected for initial Git setup.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install doro-git-essentials
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /doro-git-essentials 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release providing a comprehensive Git essentials guide. - Covers core Git commands for setup, committing, branching, and merging - Includes remote operations, history viewing, undoing changes, and stashing - Details advanced actions like rebasing, cherry-picking, submodules, and cleaning - Features common workflows, useful aliases, tips, and troubleshooting - Links to official documentation and guides
元数据
Slug doro-git-essentials
版本 1.0.0
许可证
累计安装 3
当前安装数 3
历史版本数 1
常见问题

Doro Git Essentials 是什么?

Essential Git commands and workflows for version control, branching, and collaboration. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 738 次。

如何安装 Doro Git Essentials?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install doro-git-essentials」即可一键安装,无需额外配置。

Doro Git Essentials 是免费的吗?

是的,Doro Git Essentials 完全免费(开源免费),可自由下载、安装和使用。

Doro Git Essentials 支持哪些平台?

Doro Git Essentials 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Doro Git Essentials?

由 Mus Titou(@a2mus)开发并维护,当前版本 v1.0.0。

💬 留言讨论