Claude
Skills
Sign in
Back

commit-and-push

Included with Lifetime
$97 forever

Commit and push changes

General

What this skill does


## Git State

Status:
!`git status`

Changes:
!`git diff`

Recent commits:
!`if git rev-parse --verify HEAD >/dev/null 2>&1; then git log --oneline -5; else echo "(no commits yet)"; fi`

## Task

Review the conversation context above to understand what the user was working on. Then:

1. **Identify related changes**: From the diff, determine which files are related to the work discussed in the conversation. Unrelated changes (e.g., unfinished work on a different feature) should NOT be staged.

2. **Stage selectively**: Only `git add` files that are related to the conversation context. If all changes appear related, stage everything.

3. **Generate commit message**: Write a clear commit message describing what was accomplished.

4. **Commit and push**: Commit the staged changes and push to the remote branch.

If you're unsure whether certain files are related, ask the user before staging.

Related in General