Skip to content
Back to skills

Configure Git Cli

ASecurity

Configure Git CLI with GitHub authentication using environment variables (GITHUB_EMAIL, GITHUB_NAME, GITHUB_PAT)

  • 754 stars
  • 0 votes
  • 0 copies
  • 5 views
  • Added February 8, 2026
toolsbashgit

Works with

  • cli

Security analysis

A100/100

Scanned February 12, 2026

npx -y skills add majiayu000/claude-skill-registry --skill configure-git-cli --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Configure Git Cli?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Configure Git Cli
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/majiayu000-configure-git-cli/badge)](https://www.skillsdirectory.com/skills/majiayu000-configure-git-cli)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: configure-git-cli
description: Configure Git CLI with GitHub authentication using environment variables (GITHUB_EMAIL, GITHUB_NAME, GITHUB_PAT)
compatibility: Requires git installed and GITHUB_EMAIL, GITHUB_NAME, GITHUB_PAT environment variables set
license: MIT
---

# Configure Git CLI

## When to use this skill

Use this skill before performing git operations (clone, push, commit, etc.). Required by the `codebase-fix-and-pr` skill.

## Prerequisites

**Required environment variables:**
- `GITHUB_EMAIL`: Email address for git commits
- `GITHUB_NAME`: Name for git commits
- `GITHUB_PAT`: GitHub Personal Access Token with repo and workflow scopes

## Workflow

### Step 1: Verify Git Installation

```bash
git --version
```

### Step 2: Configure Git User Identity

```bash
git config --global user.email "${GITHUB_EMAIL}"
git config --global user.name "${GITHUB_NAME}"
```

### Step 3: Configure Credentials

Enable credential storage and preload GitHub credentials:

```bash
git config --global credential.helper store
cat <<EOF > ~/.git-credentials
https://${GITHUB_NAME}:${GITHUB_PAT}@github.com
EOF
chmod 600 ~/.git-credentials
```

### Step 4: Verify Configuration

```bash
git config user.email
git config user.name
git ls-remote https://github.com/test/test.git
```

All commands should succeed without prompting for credentials.

## Success Criteria

- ✅ `git --version` succeeds
- ✅ `git config user.email` and `git config user.name` return correct values
- ✅ `git ls-remote` succeeds without prompting

## Troubleshooting

| Issue | Solution |
|-------|----------|
| Git not found | Install git using your system package manager |
| Authentication failed | Verify GITHUB_PAT is valid, not expired, and has repo scope |
| Permission denied | Check write permissions to home directory |
| Credentials not working | Run `rm ~/.git-credentials` and reconfigure |

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in tools →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.