Token导航 LogoToken导航TokenDH.com
开发敏感数据github未标认证来源可访问许可证需确认审计异常

git-configgit 配置

Agent Skill

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

总安装

186

周安装

8

GitHub Stars

61

下载量

65
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/melodic-software/claude-code-plugins --skill git-config

简介

git-config 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息。

  • 适合在 Codex、Claude、Cursor、Gemini CLI 中围绕仓库状态、代码变更或协作事项进行整理。
  • 通过 npx skills add 命令从指定 GitHub 仓库安装使用。
  • 安装前需确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写操作。
  • git-config 属于开发类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Git Configuration

Comprehensive guidance for configuring Git beyond basic installation. This skill covers global configuration, performance optimization, aliases, credential management, maintenance, and advanced configuration topics.

Table of Contents

Overview

This skill helps you:

  • Configure Git globally for optimal performance and workflow
  • Set up powerful aliases to streamline common operations
  • Manage Git credentials securely (GitHub CLI, Windows Credential Manager)
  • Configure .gitattributes for line ending control
  • Enable Git maintenance for better repository performance
  • Understand repository-level vs global configuration
  • Troubleshoot common configuration issues

For basic Git installation and setup, see the setup skill.

Example Use Cases

This skill activates for questions like:

  • "How do I set up Git aliases for common operations?"
  • "Configure Git to use GitHub CLI for authentication"
  • "My Git is slow on large repos - how can I optimize performance?"
  • "Set up.gitattributes for cross-platform development"
  • "Enable Git background maintenance"
  • "Troubleshoot 'refusing to allow OAuth App to create workflow' error"
  • "Configure Git credential helpers on Windows"
  • "Set up clone shortcuts for frequently-used repositories"
  • "Configure rerere to remember merge conflict resolutions"

When to Use This Skill

Use this skill when:

  • Configuring Git beyond basic user identity
  • Setting up aliases for common Git operations
  • Optimizing Git performance (fsmonitor, untrackedCache, parallel operations)
  • Managing Git credentials (HTTPS, SSH, token scopes)
  • Setting up GitHub CLI as credential helper
  • Configuring .gitattributes for cross-platform line ending control
  • Enabling Git background maintenance
  • Setting up clone shortcuts for frequently-used repositories
  • Troubleshooting credential issues or line ending errors
  • Understanding Git configuration hierarchy (system/global/local)

Quick Start

Most impactful configuration settings to apply immediately:

# Performance improvements
git config --global core.fsmonitor true
git config --global core.untrackedCache true
git config --global fetch.parallel 8
git config --global checkout.workers 8

# Better pull/rebase workflow
git config --global pull.rebase true
git config --global rebase.autoStash true
git config --global rebase.updateRefs true

# Auto-prune deleted remote branches
git config --global fetch.prune true
git config --global fetch.pruneTags true

# Better merge conflict resolution
git config --global merge.conflictstyle zdiff3

# Auto-setup remote tracking on first push
git config --global push.autoSetupRemote true

# Better diff algorithm
git config --global diff.algorithm histogram
git config --global diff.colorMoved zebra

# Line ending safety check
git config --global core.safecrlf warn

Quick Reference

Common Git configuration settings organized by category for quick lookup (performance, pull/rebase, fetch, push, diff, merge, line endings, sorting, maintenance).

📚 Complete Quick Reference Table: references/quick-reference.md

The quick reference table provides copy-paste commands for all common settings with category organization and purpose explanations.


Configuration File Locations

For detailed information about Git configuration file locations, hierarchy, and viewing configuration, see references/configuration-basics.md.

Quick summary:

  • System: /etc/gitconfig (or Git install dir on Windows) - All users
  • Global: ~/.gitconfig or ~/.config/git/config - Current user
  • Local: .git/config - Single repository only
  • Priority: Local > Global > System

View configuration:

# View all configuration with source files
git config --list --show-origin

# View specific value
git config user.name

Global Configuration Settings

These settings are cross-platform and recommended for all users. They should be set at the global level unless you need repository-specific overrides.

Most Essential Settings (Quick Start):

# Pull & rebase (cleaner history)
git config --global pull.rebase true
git config --global rebase.autoStash true

# Fetch (auto-prune deleted branches/tags)
git config --global fetch.prune true
git config --global fetch.pruneTags true
git config --global fetch.parallel 8

# Push (auto-setup remote tracking)
git config --global push.autoSetupRemote true

# Diff & merge (better algorithms and conflict display)
git config --global diff.algorithm histogram
git config --global diff.colorMoved zebra
git config --global merge.conflictstyle zdiff3

# Performance (filesystem monitoring)
git config --global core.fsmonitor true
git config --global core.untrackedCache true

# Sorting (newest first)
git config --global branch.sort -committerdate
git config --global tag.sort -taggerdate

📚 Complete Global Configuration Guide: references/global-configuration.md

Topics covered: Pull & rebase strategy, fetch strategy, push strategy, checkout/switch strategy, commit settings, status settings, diff settings, merge settings, rerere (conflict resolution memory), color settings, sorting, log settings, performance settings, submodule strategy, miscellaneous settings, and advanced configuration options.


Managing rerere (Reuse Recorded Resolution)

Git's rerere feature remembers how you resolved merge conflicts and can reapply those resolutions automatically.

Enable rerere:

git config --global rerere.enabled true
git config --global rerere.autoUpdate true

For detailed information about how rerere works, safety considerations, and management commands, see references/configuration-basics.md

Line Ending Strategy (Defense in Depth)

Cross-platform line ending management uses a layered approach:

  1. System level (autocrlf): Platform-specific default (Windows: true, macOS/Linux: input)
  2. Global level (safecrlf): Warns about MIXED endings (actual problems) but allows legitimate conversions
  3. Repository level (.gitattributes): Explicit control per file type

Defense in depth: These settings are complementary, not conflicting:

  • autocrlf handles the conversion automatically
  • safecrlf=warn warns about PROBLEMS (mixed line endings) but doesn't block.gitattributes conversions
  • .gitattributes provides per-repo fine-grained control

Important: Don't use safecrlf=true when you have .gitattributes - it will block legitimate conversions and cause constant errors!

Platform-specific autocrlf settings:

  • Windows: git config --global core.autocrlf true (converts LF→CRLF on checkout, CRLF→LF on commit)
  • macOS/Linux: git config --global core.autocrlf input (converts CRLF→LF on commit, no conversion on checkout)
  • WSL: git config --global core.autocrlf input (same as Linux)

Global safecrlf setting (all platforms):

# Warn about mixed line endings (safeguard against problems)
# Use 'warn' not 'true' - allows .gitattributes to work without constant errors
git config --global core.safecrlf warn

For detailed.gitattributes setup and comprehensive line ending guidance, see the line-endings skill.


Aliases

Aliases provide shortcuts for common Git operations. Categories include: information & inspection, navigation, branch operations, staging/unstaging, committing, history editing, remote operations, and tag pushing workflows.

Most Common Aliases:

# Status and branch info
git config --global alias.st "status -sb"
git config --global alias.br "branch -vv"

# Modern branch switching
git config --global alias.co "switch"
git config --global alias.cob "switch -c"

# Quick amend
git config --global alias.amend "commit --amend --no-edit"

# Safe force push
git config --global alias.pfwl "push --force-with-lease"

📚 Complete Alias Guide: references/aliases.md

Topics covered: Information & inspection aliases, navigation utilities, branch operations, staging/unstaging shortcuts, committing helpers, history editing (DANGER!), remote operations, tag pushing workflows, clone shortcuts with url.insteadOf, organization/personal shorthand patterns, and customization templates.


Clone Shortcuts

Git's url.insteadOf feature creates shorthand prefixes for clone URLs. Example: git clone gh:username/repo instead of git clone git@github.com:username/repo.git.

Quick Example:

# Universal GitHub shorthand
git config --global url."git@github.com:".insteadOf "gh:"
# Usage: git clone gh:microsoft/vscode

📚 Complete Clone Shortcuts Guide: references/aliases.md#clone-shortcuts

Topics covered: Universal GitHub shorthand, organization/personal shortcuts, corporate Git servers, custom namespace templates, and usage examples.


Repository-Level Configuration

These settings are context-specific - use them in individual repos when needed, NOT as global defaults.

When to use repo-level config:

  • Repo-specific requirements (submodules, performance, size)
  • Overriding global settings for specific workflows
  • Team-specific conventions for that repository

Examples:

# Enable submodule recursion in a specific repo
git config submodule.recurse true

# Disable ahead/behind in a massive repo (performance)
git config status.aheadBehind false

# Override line ending strategy (with .gitattributes)
git config core.autocrlf false

Maintenance

Git can perform background maintenance to keep repositories fast (commit-graph updates, incremental repacking, loose object cleanup).

Quick Setup:

# Enable background maintenance once for your account
git maintenance start

# Register each active repo for maintenance
git maintenance register

# Enable commit-graph generation globally
git config --global gc.writeCommitGraph true

Common Commands:

# Run maintenance now
git maintenance run

# See which repos are registered
git config --global --get-all maintenance.repo

# Unregister a repo
git maintenance unregister

📚 Complete Maintenance Guide: references/global-configuration.md#maintenance

Topics covered: Background maintenance tasks, scheduling (hourly/daily/weekly), task configuration, disabling full gc, maintenance.auto setting, per-task enablement, troubleshooting maintenance issues.


Git Attributes

.gitattributes provides explicit control over line endings per file type. This is the recommended approach for cross-platform teams.

Best practice: Control endings in .gitattributes and use platform-appropriate autocrlf settings with safecrlf=warn.

Quick Example:

# Auto-detect text files and normalize line endings
* text=auto

# Force LF for scripts/config (shell and CI tools expect LF)
*.sh      text eol=lf
*.yml     text eol=lf
*.json    text eol=lf

# Force CRLF for Windows-specific files
*.ps1     text eol=crlf
*.cmd     text eol=crlf
*.bat     text eol=crlf

# Mark binaries
*.png binary
*.jpg binary
*.pdf binary

Normalize existing repos with mixed endings:

git add --renormalize .
git commit -m "Normalize line endings"

📚 For comprehensive.gitattributes setup, Git LFS patterns, and line ending strategy, see the line-endings skill.


Git Credential Management

Git uses credential helpers to store and retrieve authentication credentials for remote operations (clone, fetch, push). Understanding credential management is essential for secure, efficient Git workflows.

For comprehensive credential management guidance, see references/credential-management.md.

Quick overview:

  • Windows: Default credential helper is Windows Credential Manager (manager)
  • macOS: Default is macOS Keychain (osxkeychain)
  • Linux: Default is memory cache (cache) or libsecret for persistent storage
  • GitHub users: Hybrid setup recommended (gh CLI for GitHub, OS credential manager for others)

Quick setup for GitHub (hybrid approach):

# 1. Authenticate with gh CLI
gh auth login --scopes "repo,read:org,workflow" --git-protocol https

# 2. Configure gh CLI as credential helper for GitHub only
gh auth setup-git

# 3. Verify hybrid setup
git config --list | grep credential
# Should show:
# - credential.helper=manager (or osxkeychain/cache - OS default)
# - credential.https://github.com.helper=!gh auth git-credential (GitHub-specific)

Common credential issues:

  • "refusing to allow OAuth App to create or update workflow" → Need workflow scope
  • Git still uses old/wrong credentials → Clear OS credential cache
  • SSH vs HTTPS confusion → Check remote URL with git remote -v

For detailed troubleshooting, credential helper options, security best practices, and platform-specific guidance, see references/credential-management.md.


Troubleshooting

For comprehensive troubleshooting guidance, see references/troubleshooting.md.

Quick links:


Related Skills

  • setup: Basic Git installation and initial configuration
  • line-endings: Comprehensive line ending configuration, .gitattributes, Git LFS
  • gpg-signing: GPG commit signing setup and troubleshooting
  • gui-tools: Git GUI client installation and configuration

Test Scenarios

For test scenarios validating skill activation and response quality, see references/test-scenarios.md.

Coverage: 9 scenarios covering basic use (aliases, performance, maintenance), advanced use (credentials, line endings, repo config), troubleshooting (credential issues, rerere), and shortcuts (clone shortcuts, url.insteadOf).


Version History

  • v1.3.0 (2025-11-25): Audit compliance improvements

- Extracted Test Scenarios to references/test-scenarios.md - Reduced SKILL.md from 539 to ~475 lines (under 500-line recommendation) - Improved progressive disclosure compliance

  • v1.2.0 (2025-11-12): Quality improvements based on audit recommendations

- Extracted Configuration File Locations to references/configuration-basics.md - Extracted Managing rerere to references/configuration-basics.md - Extracted Troubleshooting to references/troubleshooting.md - Added multi-model testing notes - Added common real-world usage scenarios - Reduced SKILL.md line count from 959 to ~700 lines (improved performance) - Added tables of contents to all reference files for better navigation - Created references/troubleshooting.md with comprehensive troubleshooting guidance

  • v1.1.0 (2025-11-12): Usability enhancements based on audit feedback

- Added Example Use Cases section with concrete activation examples - Added Quick Reference Table for quick lookup of common settings - Improved autonomous activation reliability

  • v1.0.0 (2025-11-09): Initial release with comprehensive Git configuration guidance

Official Documentation


Last Updated

Date: 2025-11-28 Model: claude-opus-4-5-20251101

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

32.75%
按下载量换算21

Claude

28.92%
按下载量换算19

Cursor

19.5%
按下载量换算13

Gemini CLI

10.15%
按下载量换算7

安全审计

Gen Agent Trust Hub

未通过

Socket

通过

Snyk

通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills