back to all skills
Network Sepolia|CID bafybeibvyrgm5qyyzrnsuq2yokvmaizoitlplslf3tmgmh4gvief6urdla

smartagent.eth

singlev1.0.0
$nayym install smartagent.eth

Resolves ENS, downloads from IPFS, extracts to ~/.agents/skills/

---
name: git-helper
description: Git workflow assistant for crafting commits, resolving merge conflicts, interactive rebasing, and repository hygiene. Use when the user needs help with git commands, wants to clean up commit history, resolve merge/rebase conflicts, write good commit messages, or understand what a git command does.
---

# Git Helper

## Commit Messages

Follow conventional commits when the user does not specify a format:

```
<type>(<scope>): <subject>

<body>

<footer>
```

Types: `feat`, `fix`, `docs`, `style`, `refactor`, `test`, `chore`.
Keep subject line under 72 characters. Use body for context and motivation.

## Common Workflows

**Undo last commit (keep changes)**
```bash
git reset --soft HEAD~1
```

**Undo last commit (discard changes)**
```bash
git reset --hard HEAD~1
```

**Stage parts of a file**
```bash
git add -p <file>
```

**Clean up local branches merged to main**
```bash
git branch --merged main | grep -v "^\*" | xargs -n 1 git branch -d
```

## Interactive Rebase

Present rebase as a checklist. Always suggest `--update-refs` for stacked branches.

```bash
git rebase -i --update-refs HEAD~3
```

Common operations:
- `pick` — keep commit as-is
- `reword` — edit commit message
- `squash` — meld into previous commit
- `fixup` — like squash but discard message
- `drop` — remove commit
- `exec` — run shell command

## Conflict Resolution

1. `git status` — identify conflicted files
2. Open files, search for `<<<<<<< HEAD`
3. Resolve markers, keep correct changes
4. `git add <file>` for each resolved file
5. `git rebase --continue` or `git merge --continue`

If the user is stuck mid-rebase and wants to abort:
```bash
git rebase --abort
```

## Stacked PRs / Branches

Use `git rebase --update-refs` when rebasing a stack. Mention `git branchless` only if the user seems advanced.