create
Create a new branch in the stack with the current branch as its parent. This establishes the branch relationship that rung uses for syncing and PR management.
Usage
rung create [name]rung create -m <message>rung create [name] -m <message>Aliases
rung c— shorthand forrung create
Options
| Option | Description |
|---|---|
-m, --message <message> | Commit message. Stages all changes and creates a commit. If no branch name is provided, derives the name from the message. |
Examples
Explicit Branch Name
rung create feature/authenticationCreates a new branch called feature/authentication with the current branch as its parent.
Derive Name from Message
rung create -m "feat: add user authentication"This powerful shorthand:
- Derives the branch name from the message →
feat-add-user-authentication - Creates and checks out the new branch
- Stages all changes (
git add -A) - Commits with the provided message
Explicit Name with Commit
rung create my-feature -m "feat: implement my feature"Uses the explicit name my-feature instead of deriving it from the message.
Branch Name Derivation
When using -m without an explicit name, rung converts the message to a branch name by:
- Converting to lowercase
- Replacing spaces and special characters with hyphens
- Removing duplicate hyphens
| Message | Derived Branch Name |
|---|---|
feat: add auth | feat-add-auth |
Fix login redirect | fix-login-redirect |
Add user model (WIP) | add-user-model-wip |
Workflow
# Starting from maingit checkout main
# Create first branchrung create -m "feat: add user model"# → Now on feat-add-user-model
# Make more changes, create dependent branchrung create -m "feat: add user API"# → Now on feat-add-user-api, with feat-add-user-model as parent
# Check the stackrung status Stack ────────────────────────────────────────────────── ● feat-add-user-model ← main ● ▶ feat-add-user-api ← feat-add-user-model ──────────────────────────────────────────────────
● synced ● needs sync ● conflictNotes
- The current branch becomes the parent of the new branch
- If using
-m, all staged and unstaged changes are committed - The commit message is used as the PR title when running
rung submit - You must be on a branch (not detached HEAD) to create a new branch