Agent skill

Git Version Control

by hcp4715 in hcp4715/R4Psy

Teaches Git/GitHub concepts and executes git commands. An agent skill from hcp4715/R4Psy.

CC-BY-4.0Auto-check: warningsDevelopment

Install Git Version Control

The automated check flagged lines worth reading first. See the safety section below.

skills CLI
$ npx skills add hcp4715/R4Psy --skill git-version-control -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install hcp4715/R4Psy git-version-control --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/hcp4715/R4Psy.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/git-version-control .claude/skills/git-version-control && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
git-version-control
GitHub stars
112
Token cost
~1.9k tokens
SKILL.md length
617 words
Files
2
Skills in repo
1
Repo updated
First seen
Licence
CC-BY-4.0

At a glance

Teaches Git/GitHub concepts and executes git commands. An agent skill from hcp4715/R4Psy.

  • Works in 5 steps: Educational Content (Based on… → Git Commands Reference → GitHub Operations → …
  • S ask about version control
  • SKILL.md covers Overview, When to Invoke, Capabilities and Execution Guidelines, plus 3 more sections
  • Calls git and gh

What it does

Git Version Control is an agent skill from hcp4715/R4Psy. Teaches Git/GitHub concepts and executes git commands. Invoke when users ask about version control, need help with git operations, or want to learn R4Psy Chapter 3.2 content.

Its SKILL.md is about 1.9k tokens, which your agent loads only when the skill is triggered. The skill folder holds 1 other file (for example `STUDENT_GUIDE.md`).

It sits in Development, covering Git workflow. It works with Git and GitHub. The repository describes itself as: R for psychological research (NNU grad course). The licence is CC-BY-4.0.

When your agent uses it

  • S ask about version control
  • Need help with git operations
  • Want to learn R4Psy Chapter 3.2 content

Example prompts

  • “Use the git-version-control skill to teach Git/GitHub concepts and executes git commands. An agent skill from hcp4715/R4Psy”
  • “/git-version-control”

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. Educational Content (Based on chapter_3.Rmd)
  2. Git Commands Reference
  3. GitHub Operations
  4. Authentication Setup
  5. Error Handling

What it can do on your machine

Read from SKILL.md and the folder at commit e94f744. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • git
    • gh

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • git-scm.com
    • github.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Git Version Control loads about 1.9k tokens when it runs. Until then it costs about 49 tokens; SKILL.md has 617 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~49
When it runs · the whole SKILL.md, loaded when a task matches
~1.9k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: warnings

The automated check found patterns that need a careful read before installing.

  • WarningMentions a credentials file (SSH keys, cloud or package-manager tokens)SKILL.md:193
    ssh-add ~/.ssh/id_ed25519
  • WarningMentions a credentials file (SSH keys, cloud or package-manager tokens)SKILL.md:196
    # macOS: pbcopy < ~/.ssh/id_ed25519.pub

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from hcp4715/R4Psy at commit e94f744, republished under its CC-BY-4.0 licence (© hcp4715). 617 words, ~1,936 tokens.

Download SKILL.mdSave it as .claude/skills/git-version-control/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
git-version-control
description
Teaches Git/GitHub concepts and executes git commands. Invoke when users ask about version control, need help with git operations, or want to learn R4Psy Chapter 3.2 content.

Git Version Control Skill

Overview

This skill helps users understand and use Git and GitHub based on the R4Psy course materials (Chapter 3.2). It combines educational content from slides/chapter_3.Rmd with practical command execution capabilities.

When to Invoke

  • User asks about version control concepts (版本控制)
  • User needs help with Git installation or configuration
  • User wants to execute git commands (init, add, commit, push, pull, etc.)
  • User needs guidance on GitHub operations (create repo, clone, fork, etc.)
  • User encounters git errors or conflicts
  • User references R4Psy Chapter 3 or asks about course content

Capabilities

1. Educational Content (Based on chapter_3.Rmd)
1.1 Version Control Concepts (3.2.1)
  • Definition: 版本控制(Version Control)是一种管理文件修改历史的系统,特别是用于源代码管理。
  • Categories:
    • 本地版本控制 (Local): 在用户的个人计算机上运行,管理和跟踪文件或项目的历史版本
    • 远程版本控制 (Remote): 侧重于团队协作和共享资源,依托于服务器或云服务
1.2 Git Fundamentals (3.2.2)
  • Git is the most commonly used free and open-source version control tool
  • Installation: https://git-scm.com/downloads
  • Mac users may need to install homebrew first

Two Operation Modes:

  • Terminal: Full functionality via Git Bash, CMD, R Terminal, etc.
  • GUI Panel: Visual interface like R Studio Git panel, GitHub Desktop
1.3 GitHub Overview (3.2.3)
  • GitHub is the world's largest open-source online software source code hosting platform
  • Uses Git for version control
  • Acquired by Microsoft in 2018
  • Alternatives: Gitee, GitLab, Bitbucket
  • Registration: https://github.com
2. Git Commands Reference
Initialization & Setup
bash
# Initialize a new repository
git init

# Clone an existing repository
git clone <repository-url>

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

# Check configuration
git config --list
Daily Workflow
bash
# Check repository status
git status

# Stage changes
git add <file>           # Add specific file
git add .                # Add all changes

# Commit changes
git commit -m "Commit message"

# View commit history
git log
git log --oneline        # Compact view
git log --graph          # Visual graph
Branch Operations
bash
# List branches
git branch

# Create new branch
git branch <branch-name>

# Switch branch
git checkout <branch-name>
git switch <branch-name>  # Modern syntax

# Create and switch
git checkout -b <branch-name>
git switch -c <branch-name>  # Modern syntax

# Merge branch
git merge <branch-name>

# Delete branch
git branch -d <branch-name>   # Safe delete
git branch -D <branch-name>   # Force delete
Remote Operations
bash
# Add remote repository
git remote add origin <repository-url>

# View remotes
git remote -v

# Push to remote
git push origin <branch-name>
git push -u origin <branch-name>  # Set upstream

# Pull from remote
git pull origin <branch-name>

# Fetch updates
git fetch origin

# Push all branches
git push --all origin
Undo Operations
bash
# Unstage files
git reset HEAD <file>
git restore --staged <file>  # Modern syntax

# Discard local changes
git checkout -- <file>
git restore <file>           # Modern syntax

# Amend last commit
git commit --amend

# Reset to specific commit
git reset --soft HEAD~1      # Keep changes staged
git reset --mixed HEAD~1     # Keep changes unstaged
git reset --hard HEAD~1      # Discard changes

# Stash changes
git stash
git stash list
git stash pop
git stash drop
3. GitHub Operations
Browser-based Operations
  1. Create Repository: User profile → Repositories → New
  2. Fork Repository: Click "Fork" button on any public repo
  3. Pull Requests: Compare & pull request → Create pull request
  4. Issues: Create and manage project issues
GitHub CLI Integration
bash
# Install GitHub CLI (if not installed)
# macOS: brew install gh
# Windows: winget install --id GitHub.cli

# Authenticate
gh auth login

# Create repository
gh repo create <repo-name>

# Clone repository
gh repo clone <owner>/<repo>

# Create pull request
gh pr create

# View issues
gh issue list
4. Authentication Setup
SSH Key Setup
bash
# Generate SSH key
ssh-keygen -t ed25519 -C "your.email@example.com"

# Add to SSH agent
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519

# Copy public key to clipboard
# macOS: pbcopy < ~/.ssh/id_ed25519.pub
# Add to GitHub: Settings → SSH and GPG keys → New SSH key
Personal Access Token (PAT)
  1. GitHub → Settings → Developer settings → Personal access tokens
  2. Generate new token (classic) or Fine-grained token
  3. Select scopes: repo, workflow, etc.
  4. Use token as password when prompted
5. Error Handling
Common Issues & Solutions

Merge Conflicts:

bash
# Identify conflicted files
git status

# Edit files to resolve conflicts (look for <<<<<<< HEAD)
# Then stage and commit
git add <resolved-files>
git commit -m "Resolve merge conflict"

Permission Denied:

  • Check SSH key configuration
  • Verify PAT has correct scopes
  • Ensure correct repository access

Detached HEAD State:

bash
# Create new branch from detached state
git checkout -b <new-branch-name>

# Or return to previous branch
git checkout <branch-name>

Execution Guidelines

Teaching Mode
  1. When user asks about concepts, quote directly from chapter_3.Rmd (in Chinese)
  2. Provide context and examples to enhance understanding
  3. Reference specific sections (3.2.1, 3.2.2, 3.2.3) when applicable
Show full SKILL.md (269 more words)Show less
Command Execution Mode
  1. Safety First: Always confirm before executing destructive commands (reset --hard, push --force, etc.)
  2. Explain Before Execute: Describe what the command does before running it
  3. Show Output: Display command output with explanations
  4. Check Status: Use git status frequently to show current state
Interactive Guidance
  1. Assess Level: Ask about user's experience level if unclear
  2. Step-by-Step: Break complex operations into manageable steps
  3. Verify Understanding: Confirm user understands each step before proceeding
  4. Provide Alternatives: Offer both terminal and GUI options when applicable

Workflow Examples

First-time Setup
  1. Install Git
  2. Configure identity
  3. Set up SSH key or PAT
  4. Verify with git --version and test connection
Starting a New Project
  1. Create GitHub repository (browser or gh CLI)
  2. Clone locally: git clone <url>
  3. Add files and make initial commit
  4. Push to remote
Daily Development Loop
  1. Pull latest changes: git pull
  2. Create feature branch: git checkout -b feature-name
  3. Make changes and commit regularly
  4. Push branch: git push -u origin feature-name
  5. Create pull request on GitHub
  6. Merge and clean up branches

Language Policy

  • SKILL.md: English (this file)
  • User Interaction: Chinese (consistent with chapter_3.Rmd source)
  • Command Output: Preserve original language (English for git commands)
  • Explanations: Chinese with English terms in parentheses when helpful

Safety Warnings

⚠️ Never:

  • Execute git push --force without explicit user confirmation
  • Run git reset --hard without checking for uncommitted changes
  • Share or log authentication credentials
  • Assume repository state without checking first

✅ Always:

  • Check git status before and after operations
  • Confirm destructive actions
  • Explain potential side effects
  • Offer to create backups when appropriate

© hcp4715, CC-BY-4.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file in skills/git-version-control of hcp4715/R4Psy.

  • SKILL.md
  • STUDENT_GUIDE.md

Open the folder on GitHubat commit e94f744

Compare with similar skills

Git Version Control next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Git Version Control compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Git Version Control this skillhcp4715/R4Psy112—~1.9kAutomated safety check: WarnCC-BY-4.0
Contributor-First PR MergeHKUDS/OpenHarness16k1 repos~847Automated safety check: PassMIT
Create Pull Requestcline/cline70k1 repos~1.6kAutomated safety check: PassApache-2.0
Release Bumpjamiepine/voicebox57k—~1.1kAutomated safety check: PassMIT
Creating Description For Gh PRredis/jedis12k—~838Automated safety check: PassMIT
Create Pull Request with Work Item IDmakeplane/plane61k—~824Automated safety check: PassAGPL-3.0

Similar skills

  • Merges external GitHub pull requests while keeping the original author credited, and fixes conflicts after the merge instead of rewriting the contribution.

    16k GitHub starsUsed in 1 repo~847 tokens
    DevelopmentAuto-check passed
  • Opens a GitHub pull request from your current branch with the gh CLI, after reviewing the commits and diff and gathering the details the PR needs.

    70k GitHub starsUsed in 1 repo~1.6k tokens
    DevelopmentAuto-check passed
  • Release Bump

    jamiepine/voicebox

    Ends a release cycle by moving the Unreleased changelog notes under a dated version heading, bumping version files with bumpversion and tagging the commit.

    57k GitHub stars~1.1k tokensUpdated 2 days ago
    DevelopmentAuto-check passed
  • Official

    Generate a clear, concise GitHub PR title and description from the diff between two local git branches, and save it to prDescription.md in the repo root.

    12k GitHub stars~838 tokensUpdated today
    DevelopmentAuto-check passed
  • Opens a pull request for the current branch using the repo's template, a work item ID in the title and a description filled in from the actual diff.

    61k GitHub stars~824 tokensUpdated today
    DevelopmentAuto-check passed
  • React Router Pull Request Creator

    remix-run/react-router

    Packages finished React Router work into a draft pull request: branch, commit, push, a written PR body and the right GitHub labels.

    57k GitHub stars~2.5k tokensUpdated today
    DevelopmentAuto-check passed

Works with

Categories

Questions about Git Version Control

What does Git Version Control do?

Teaches Git/GitHub concepts and executes git commands. An agent skill from hcp4715/R4Psy. Git Version Control is an agent skill from hcp4715/R4Psy. Teaches Git/GitHub concepts and executes git commands.

When should I use Git Version Control?

Git Version Control fits situations like: S ask about version control; need help with git operations; want to learn R4Psy Chapter 3.2 content.

How do I install Git Version Control in Claude Code?

Run `npx skills add hcp4715/R4Psy --skill git-version-control -a claude-code`. Or copy the skill folder (skills/git-version-control in hcp4715/R4Psy) into .claude/skills/git-version-control in your project. Claude Code loads it when a task matches its description.

How do I install Git Version Control in Codex?

Run `npx skills add hcp4715/R4Psy --skill git-version-control -a codex`. Or copy the skill folder (skills/git-version-control in hcp4715/R4Psy) into .agents/skills/git-version-control in your project. Codex loads it when a task matches its description.

Can I use Git Version Control in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add hcp4715/R4Psy --skill git-version-control -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/git-version-control, .gemini/skills/git-version-control, .github/skills/git-version-control and .opencode/skills/git-version-control in your project.

What does Git Version Control need to run?

Going by SKILL.md and its folder, Git Version Control needs the command-line tools its instructions call (git and gh).

Does Git Version Control access the network?

SKILL.md names 2 domains. As links in the text: git-scm.com and github.com. This is read from the text; nothing was executed.

Is Git Version Control safe to install?

Our automated static check of SKILL.md flagged 2 warning(s): mentions a credentials file (ssh keys, cloud or package-manager tokens). Read the flagged lines before installing; the check is not a guarantee either way.

What licence does Git Version Control use?

Git Version Control is published under the CC-BY-4.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Git Version Control use?

About 1.9k tokens (SKILL.md is roughly 7.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Git Version Control?

Skills that share tags, products or a category with Git Version Control: Contributor-First PR Merge (HKUDS/OpenHarness, 16k stars), Create Pull Request (cline/cline, 70k stars), Release Bump (jamiepine/voicebox, 57k stars) and Creating Description For Gh PR (redis/jedis, 12k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Git Version Control?

hcp4715 (a GitHub user) maintains it in hcp4715/R4Psy, which has 112 GitHub stars. The repository was last updated on July 28, 2026.

Source: hcp4715/R4Psy on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.