diff --git a/README.md b/README.md index e1c59dc..cacb5e8 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ pairing with smart people at Hashrocket. For a steady stream of TILs, [sign up for my newsletter](https://visualmode.kit.com/newsletter). -_1706 TILs and counting..._ +_1707 TILs and counting..._ See some of the other learning resources I work on: @@ -664,6 +664,7 @@ If you've learned something here, support my efforts writing daily TILs by ### jj - [Colocate jj And git Directories For Project](jj/colocate-jj-and-git-directories-for-project.md) +- [Describe Current Changes And Create New Change](jj/describe-current-changes-and-create-new-change.md) - [Find System-wide Config File For User](jj/find-system-wide-config-file-for-user.md) - [Squash Changes Into Parent Commit Interactively](jj/squash-changes-into-parent-commit-interactively.md) diff --git a/jj/describe-current-changes-and-create-new-change.md b/jj/describe-current-changes-and-create-new-change.md new file mode 100644 index 0000000..0db5737 --- /dev/null +++ b/jj/describe-current-changes-and-create-new-change.md @@ -0,0 +1,28 @@ +# Describe Current Changes And Create New Change + +One of the first patterns I learned with `jj` was a pair of commands to +essentially "commit" the working copy and start a fresh, new change. So if I am +done making some changes, I can add a description to the `(no description)` +working copy and then start a new working copy _change_. + +```bash +$ jj describe -m "Add status subcommand to show current status" +$ jj new +``` + +I learned from [Steve](https://steveklabnik.com/) in the [jj +discord](https://discord.gg/dkmfj3aGQN) that a shorthand for this pattern is to +use the `jj commit` command directly. + +> When called without path arguments or `--interactive`, `jj commit` is +> equivalent to `jj describe` followed by `jj new`. + +That means, instead of the above pair of commands, I could have done: + +```bash +$ jj commit -m "Add status subcommand to show current status" +``` + +That would have had the same result in my case. However, notice the caveats +mentioned in the quote above and check out `man jj-commit` for more details on +that.