git-workflow
Scannednpx machina-cli add skill aiskillstore/marketplace/git-workflow --openclawFiles (1)
SKILL.md
2.7 KB
Git Workflow
Streamline git operations with visual tools and GitHub CLI integration.
Tools
| Tool | Command | Use For |
|---|---|---|
| lazygit | lazygit | Interactive git TUI |
| gh | gh pr create | GitHub CLI operations |
| delta | git diff | delta | Beautiful diff viewing |
lazygit Essentials
# Open interactive TUI
lazygit
# Key bindings:
# Space - stage/unstage file
# c - commit
# p - push
# P - pull
# b - branch operations
# r - rebase menu
# s - stash menu
# ? - help
GitHub CLI (gh) Essentials
# Pull Requests
gh pr create --title "Feature: Add X" --body "Description"
gh pr create --web # Open in browser
gh pr list # List open PRs
gh pr view 123 # View PR details
gh pr checkout 123 # Check out PR locally
gh pr merge 123 --squash # Squash and merge
# Issues
gh issue create --title "Bug: X"
gh issue list --label bug
# Repository
gh repo view --web # Open in browser
# Actions
gh workflow run deploy.yml
gh run list --workflow=ci.yml
Delta (Beautiful Diffs)
# View diff with syntax highlighting
git diff | delta
# Side-by-side view
git diff | delta --side-by-side
# Configure as default pager
git config --global core.pager delta
Quick Reference
| Task | Command |
|---|---|
| Interactive git | lazygit |
| Create PR | gh pr create |
| Merge PR | gh pr merge --squash |
| Beautiful diff | git diff | delta |
| Interactive rebase | git rebase -i HEAD~N |
| Stash changes | git stash push -m "msg" |
| Apply stash | git stash pop |
| Find bug commit | git bisect start |
| Cherry-pick | git cherry-pick <hash> |
| Parallel worktree | git worktree add <path> <branch> |
| Recover commits | git reflog |
When to Use
- Interactive staging of changes
- Creating pull requests from terminal
- Reviewing PRs and issues
- Visual diff viewing
- Cleaning up commit history (rebase)
- Temporary work saving (stash)
- Bug hunting (bisect)
- Parallel feature work (worktrees)
- Recovering lost work (reflog)
Additional Resources
For detailed patterns, load:
./references/rebase-patterns.md- Interactive rebase workflows./references/stash-patterns.md- Stash operations and workflows./references/advanced-git.md- Bisect, cherry-pick, worktrees, reflog, conflicts
Source
git clone https://github.com/aiskillstore/marketplace/blob/main/skills/0xdarkmatter/git-workflow/SKILL.mdView on GitHub Overview
Git Workflow streamlines core git and GitHub tasks by combining a visual TUI (lazygit), the GitHub CLI (gh), and delta for readable diffs. It covers interactive staging/committing, PR creation and review, diff viewing, and history cleanup via rebase and stash.
How This Skill Works
The skill maps everyday git tasks to concrete commands: use lazygit for interactive staging and commits, gh for PR/issue management, and delta to render git diffs. It also includes scripting patterns for rebase and stash to tidy history and save work.
When to Use It
- Interactive staging and committing of changes with lazygit
- Creating and managing PRs from the terminal with gh
- Reviewing open PRs and issues via gh and local checks
- Viewing beautiful, side-by-side diffs with delta
- Cleaning up history and saving work using interactive rebase and stash
Quick Start
- Step 1: Open lazygit to stage and commit changes.
- Step 2: Create a PR from the terminal using gh pr create with a descriptive title/body.
- Step 3: Review diffs with git diff | delta and tidy history with git rebase -i HEAD~N.
Best Practices
- Use lazygit's staging and commit prompts to craft meaningful commits
- Run delta diffs before staging to spot changes
- Create PRs from terminal with a clear title/body
- Use interactive rebase to tidy commits; avoid rewriting public history
- Leverage stash with descriptive messages when context is needed
Example Use Cases
- Stage changes in lazygit, commit with a clear message, push, and open a PR with gh pr create.
- Checkout and review a PR with gh pr view, then merge with gh pr merge --squash.
- Review diffs with git diff | delta before finalizing commits.
- Rebase interactively to squash commits: git rebase -i HEAD~3.
- Use git bisect start to locate a bug and mark good/bad commits.
Frequently Asked Questions
Add this skill to your agents