-
Notifications
You must be signed in to change notification settings - Fork 349
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This answers some questions, which were repeatedly asked in Discord.
- Loading branch information
1 parent
c8f7a5f
commit 3e35ab4
Showing
2 changed files
with
80 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
# Frequently asked questions | ||
|
||
### Why does my branch not move to the new commit after `jj new/commit`? | ||
|
||
If you're familiar with Git, you might expect the current branch to move forward | ||
when you commit. However Jujutsu does not have a concept of a "current branch". | ||
|
||
To move branches, use `jj branch set`. | ||
|
||
### I made a commit and `jj git push --all` says "Nothing changed" instead of pushing it. What do I do? | ||
|
||
`jj git push --all` pushes all _branches_, not all revisions. You have two | ||
options: | ||
|
||
* Using `jj git push --change` will automatically create a branch and push it. | ||
* Using `jj branch` commands to create or move a branch to either the commit | ||
you want to push or a descendant on it. Unlike Git, Jujutsu doesn't do this | ||
automatically (see previous question). | ||
|
||
### Where is my commit, why is it not visible in `jj log`? | ||
|
||
Is your commit visible with `jj log -r 'all()'`? | ||
|
||
If yes, you should be aware that `jj log` only shows the revisions matching | ||
`revsets.log` by default. You can change it as described in [config] to show | ||
more revisions. | ||
|
||
If not, the revision may have been abandoned (e.g because you used `jj abandon` | ||
, or because it's an obsolete version that's been rewritten with `jj rebase`, | ||
`jj describe`, etc) In that case, `jj log -r commit_id` should show the | ||
revision as "hidden". `jj new commit_id` or `jj edit commit_id` should make the | ||
revision visible again. | ||
|
||
See [revsets] and [templates] for further guidance. | ||
|
||
### How do I partially add changes from a file? | ||
|
||
With Jujutsu you never partially add hunks, as you're always amending the | ||
working-copy commit. You need to split it, as the `@` may already be complete. | ||
|
||
This is easy doable with `jj split your-file` | ||
|
||
|
||
### Is there something like `git rebase --interactive`? | ||
|
||
Not yet, you can check [this issue] for updates. | ||
|
||
To reorder commits, it is for now recommended to rebase commits individually, | ||
which may require multiple invocations of `jj rebase -r` or `jj rebase -r` | ||
|
||
To squash or split commits, use `jj squash` and `jj split`. | ||
|
||
### How can I keep my scratch files in the repository? | ||
|
||
You can keep your notes and other scratch files in the repository, if you add | ||
a wildcard pattern to either the repos `gitignore` or your global `gitignore`. | ||
Something like `*.scratch` or `*.scratchpad` should do, after that rename the | ||
files you want to keep around to match the pattern. | ||
|
||
If `$EDITOR` integration is important, something like `scratchpad.*` may be more | ||
helpful, as you can keep the filetype intact (it matches `scratchpad.md`, | ||
`scratchpad.rs` and more). | ||
|
||
You can find more details on `gitignore` files [here][gitignore]. | ||
|
||
### How can I keep local changes around, but not use them for Pull Requests? | ||
|
||
In general, you should create a commit, which incorporates your local changes. | ||
After that rebase all your pending PR's on it. Then just before creating a PR, | ||
remove the change from the branches history with | ||
`jj rebase -s $change-id -d main` to keep it on the local `main` branch. | ||
|
||
|
||
[config]: ./config.md | ||
[gitignore]: https://git-scm.com/docs/gitignore | ||
[revsets]: ./revsets.md | ||
[templates]: ./templates.md | ||
[this issue]: https://github.com/martinvonz/jj/issues/1531 |