39 lines
1.1 KiB
Markdown
39 lines
1.1 KiB
Markdown
### Pushing Changes
|
|
|
|
When the user asks you to push changes:
|
|
|
|
```bash
|
|
# Push a specific bookmark to the remote
|
|
jj git push -b <bookmark-name>
|
|
|
|
# Example: push the main bookmark
|
|
jj git push -b main
|
|
```
|
|
|
|
**Before pushing, ensure:**
|
|
1. Your bookmark points to the correct commit (bookmarks don't auto-advance like git branches)
|
|
2. The commits are refined and atomic
|
|
3. The user has explicitly requested the push
|
|
|
|
**IMPORTANT**: Unlike git branches, jj bookmarks do not automatically move when you create new commits. You must manually update them before pushing:
|
|
|
|
```bash
|
|
# Move an existing bookmark to the current commit
|
|
jj bookmark move my-feature --to @
|
|
|
|
# Then push it
|
|
jj git push -b my-feature
|
|
```
|
|
|
|
If no bookmark exists for your changes, create one first:
|
|
|
|
```bash
|
|
# Create a bookmark at the current commit
|
|
jj bookmark create my-feature
|
|
|
|
# Then push it
|
|
jj git push -b my-feature
|
|
```
|
|
|
|
For named remotes, multi-remote setups (e.g. fork + upstream), tracking remote bookmarks, and one-time configuration for the two canonical multi-remote workflows, see `references/REMOTES.md`.
|