Skip to content
Back to skills

1877 Git F39bcc62

ASecurity

Guidelines for effective git usage in gptme.

  • 9 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added June 1, 2026
code-qualityshellgitdocumentation

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned June 1, 2026

npx -y skills add tools-only/X-Skills --skill 1877-git_f39bcc62 --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of 1877 Git F39bcc62?

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

Security grade badge for 1877 Git F39bcc62
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/tools-only-1877-git-f39bcc62/badge)](https://www.skillsdirectory.com/skills/tools-only-1877-git-f39bcc62)

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
---
match:
  keywords: [git, commit, push, branch, pr, pull request, worktree]
  tools: [shell, gh]
---

# Git Workflow Best Practices

Guidelines for effective git usage in gptme.

## Commit Best Practices

1. **Use Conventional Commits format**:
   - `feat:` - New features (not just docs)
   - `fix:` - Bug fixes
   - `docs:` - Documentation only changes
   - `refactor:` - Code restructuring
   - `test:` - Test additions/changes
   - `chore:` - Maintenance tasks

2. **Stage files selectively**:
```shell
# Check what changed
git status

# Stage specific files
git add path/to/file.py

# ❌ Never use git add . or git add -A
```

3. **Write clear commit messages**:
```shell
# Use HEREDOC for complex messages
git commit -m "$(cat <<'EOF'
feat: add new feature

Detailed explanation of the feature
and its benefits.
EOF
)"
```

## Branch Workflow

1. **Create feature branches for non-trivial changes**:
```shell
git checkout -b feat/new-feature
```

2. **Keep branches focused**: One logical change per branch

3. **Create PRs for review**:
```shell
gh pr create --title 'Title' --body 'Description'
```

## Working with PRs

### Reading PRs with full context
```shell
# Use the enhanced PR viewer
~/Programming/gptme/scripts/gh-pr-view-with-pr-comments.sh $PR_URL
```

### Checking PR status
```shell
# View PR details
gh pr view $PR_URL

# Check CI status
gh pr checks $PR_URL
```

## Common Mistakes to Avoid

- ❌ Don't use `git reset --hard` (destructive)
- ❌ Don't use `git commit -a` (stages all files)
- ❌ Don't use `git add -A` or `git add .` (adds unintended files)
- ✅ Use `git status` before commits
- ✅ Stage files explicitly with `git add`
- ✅ Use `git stash` to save uncommitted changes

## Using Git Worktrees

Worktrees allow parallel work on multiple branches without switching.

### Best Practice: Use /tmp/ for Worktrees

```shell
# Create worktree in /tmp/ (recommended)
git worktree add /tmp/gptme-feat-name feat/feature-name

# Work in the worktree
cd /tmp/gptme-feat-name
# ... make changes, commit, push ...

# Clean up when done
git worktree remove /tmp/gptme-feat-name
```

### Why /tmp/?

- ✅ **Auto-cleaned**: Removed on reboot (no orphaned worktrees)
- ✅ **No duplicates**: grep/find/ripgrep won't find duplicate files
- ✅ **No accidents**: Can't accidentally commit worktree directory
- ✅ **Clean project**: Main repo stays uncluttered

### Avoid These Patterns

- ❌ `./worktree/` - Causes grep duplicates, often not cleaned up
- ❌ `../repo-worktree-feat` - Messy sibling directories
- ❌ Forgetting to remove worktrees after PR merge

### Worktree Commands

```shell
# List all worktrees
git worktree list

# Check if worktree exists before creating
git worktree list | grep feat-name

# Remove a worktree
git worktree remove /tmp/gptme-feat-name

# Prune stale worktree references
git worktree prune
```

Files in this skill

  • README.md725 B
  • skill.md2.8 KB

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.

Comments

Loading comments…

Newsletter

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