git-workflowlisted
Install: claude install-skill juan294/cc-rpi
# Git Workflow
## Push Sequence
Wrong -- unstaged changes break the pull:
```bash
git pull --rebase && git push
```
Right -- commit before pulling (clean tree required):
```bash
git add <files> && git commit -m "msg" && git pull --rebase && git push
```
Pull before push even on a branch you just committed to -- the remote may
have advanced from other sessions or parallel agents since you last fetched.
## Empty Repositories
Wrong -- `git log` and `git diff HEAD` fail on a repo with no commits yet:
```bash
git log -1
git diff HEAD
```
Right -- check for a HEAD first:
```bash
git rev-parse HEAD 2>&1 || echo "no commits yet -- skip log/diff HEAD"
```
## First Push / PR Creation
Wrong -- no upstream, push and gh pr create both fail:
```bash
git push && gh pr create --title "feat: thing"
```
Right -- set upstream on first push:
```bash
git push -u origin <branch> && gh pr create --title "feat: thing"
```
## Push with Tag
Wrong -- pushes ALL local tags, fails if any old tag exists on remote:
```bash
git push --tags
```
Right -- push specific tags by name or use --follow-tags:
```bash
git push origin main && git push origin v1.0.0
```
## Branch Verification
Wrong -- assume branch from conversation context:
```bash
git commit -m "feat: add feature"
```
Right -- verify branch before every commit:
```bash
git branch --show-current && git commit -m "feat: add feature"
```
## Worktree Management
Wrong -- relative paths and lowercase -d:
```bash
cd ../worktree