Create a Pull Request
This tutorial walks through creating a single pull request using LazyJJ.
Prerequisites
- LazyJJ installed
- GitHub CLI (
gh) installed and authenticated - A Git repository with a GitHub remote
Step 1: Start Fresh from Trunk
Begin by syncing with the latest trunk and starting a new commit:
jj stack-startThis command:
- Fetches the latest changes from the remote
- Creates a new commit on top of trunk
Step 2: Make Your Changes
Edit files as usual. In JJ, your working copy is a commit, so changes are automatically tracked:
# Edit files with your favorite editorvim src/auth.js
# Check what's changedjj status
# See the diffjj diffNo git add needed - all changes are part of your current commit.
Step 3: Describe Your Commit
Add a commit message describing your changes:
jj describe -m "feat: Add user authentication"You can run this multiple times to update the message.
Step 4: Create a Bookmark
PRs need a branch name. Create a bookmark (JJ’s term for a branch):
jj bookmark-create auth-featureThis creates a bookmark pointing at your current commit.
Note about Bookmarks vs Branches: JJ calls them “bookmarks” while GitHub calls them “branches.” They’re the same thing. Why the different term? JJ bookmarks don’t auto-follow like Git branches—you must manually update them. This is THE most common confusion for Git users. See Common Mistakes for details.
Step 5: Push and Create the PR
Push your changes and create a PR in one command:
jj pr-stack-createThis will:
- Push your bookmark to the remote
- Create a PR on GitHub (or update if it exists)
- Open the PR form if it’s new
Step 6: Respond to Feedback
When reviewers request changes:
# Make your changesvim src/auth.js
# Changes are automatically in your commit!# Just push the updatejj stack-submitNo need to amend or create fixup commits. Your working copy automatically updates the commit.
Complete Workflow
Here’s the entire flow in one block:
# Start freshjj stack-start
# Make changesvim src/auth.jsvim src/login.js
# Describe your workjj describe -m "feat: Add user authentication
- Add auth middleware- Add login endpoint- Add session handling"
# Create bookmark for PRjj bookmark-create auth-feature
# Push and create PRjj pr-stack-createTips
Viewing Your PR
# View PR details in terminaljj pr-view
# Open PR in browserjj pr-openUpdating After Review
# Make requested changesvim src/auth.js
# Push updates (PR updates automatically)jj stack-submitDraft PRs
When creating a PR with jj pr-stack-create, you can choose to create it as a draft.
Next Steps
- Learn to Create a Stack of PRs
- See how to Navigate Your Stack
- Learn about Syncing with Remote
Ernesto Jiménez