graphite-cli
This skill should be used to answer questions and guide workflows related to the Graphite CLI. It assists with creating, managing, submitting, and synchronizing stacked code changes (diffs).
Оригинален текст · няма потвърден превод на българскиПърво прочетете инструкцията.
Файлът се зарежда от посочения източник само по ваше действие. Можете да го прочетете тук, да го копирате или да го запазите като .md.
GitHub хранилище- Звезди на репото
- 428
- Лиценз
- Не е посочен. Проверете в репозитория.
- Последна проверка на записа
- Няма посочена дата
Добавете в своя инструмент.
Командата отваря избора на skills от репозитория. Прочетете файла и условията на автора преди изпълнение.
npx skills add aiskillstore/marketplaceСтраницата копира текст. Не инсталира и не изпълнява нищо на устройството ви.
Откъс от SKILL.md
Началото на файла на автора, без превод.
Graphite CLI Guide
This skill provides procedural knowledge for working with the Graphite command-line interface (CLI). It covers the entire lifecycle of creating and managing stacked pull requests, from initial setup to advanced stack manipulation.
When to Use This Skill
Activate this skill when a user's request involves using the gt command, managing stacked pull requests, or inquiring about the Graphite workflow. It is designed to handle tasks such as creating branches, submitting PRs, synchronizing with the trunk branch, and modifying the structure of a stack.
Core Concepts
- Stack: A series of small, incremental, and dependent branches. Each branch is a distinct PR, building on the previous one.
- Trunk: The primary branch of the repository (usually
mainormaster) from which all stacks originate and into which they are eventually merged.
I. Initial Setup
To begin using Graphite in a git repository, it must be initialized.
- Authenticate: Run
gt authto connect the CLI to your GitHub account via an auth token. - Initialize Repository: Navigate to the repository root and run
gt init. This command will prompt to select the trunk branch.
II. Core Workflow: Creating & Submitting Changes
This workflow covers the fundamental loop of creating, submitting, and updating branches.
Step 1: Create a Branch
To create a new branch and commit changes, use gt create. This command replaces git add, git commit, and git checkout -b. The new branch will be stacked on the currently checked-out branch.
| Command | Alias/Flags | Description |
|---|---|---|
gt create | gt c | Creates a new branch and commits staged changes. |
gt create -m <MSG> | gt c -m | Creates a branch with a specific commit message. |
gt create -a | gt c -a | Stages all unstaged changes before committing. |
gt create -am <MSG> | gt c -am | Combines staging all changes and adding a message. |
Example:
To create a branch from main with all current file changes and a commit message:
- Checkout the trunk:
gt checkout main - Make code edits.
- Create the branch:
gt create -am "feat: Add new user model"
Step 2: Submit for Review
To push a branch (or a stack of branches) and open pull requests on GitHub, use gt submit.