diff --git a/docs/src/git.md b/docs/src/git.md index b31d9db585..d562eb4d0a 100644 --- a/docs/src/git.md +++ b/docs/src/git.md @@ -29,6 +29,23 @@ In the panel you can see the state of your project at a glance—which repositor Zed monitors your repository so that changes you make on the command line are instantly reflected. +### Configuration + +You can configure how Zed hard wraps commit messages with the `preferred-line-length` setting of the "Git Commit" language. The default is `72`, but it can be set to any number of characters `0` or more. + +The Git Panel also allows configuring the `soft_wrap` setting to adjust how commit messages display while you are typing them in the Git Panel. The default setting is `editor_width`, however, `none`, `preferred_line_length`, and `bounded` are also options. + +#### Example + +```json +"languages": { + "Git Commit": { + "soft_wrap": "editor_width", + "preferred_line_length": 72 + }, +} +``` + ## Project Diff You can see all of the changes captured by Git in Zed by opening the Project Diff ({#kb git::Diff}), accessible via the {#action git::Diff} action in the Command Palette or the Git Panel. @@ -75,6 +92,12 @@ Zed offers two commit textareas: As soon as you commit in Zed, in the Git Panel, you'll see a bar right under the commit textarea, which will show the recently submitted commit. In there, you can use the "Uncommit" button, which performs the `git reset HEADˆ--soft` command. +### Configuring Commit Line Length + +By default, Zed sets the commit line length to `72` but it can be configured in your local `settings.json` file. + +Find more information about setting the `preferred-line-length` in the [Configuration](#configuration) section. + ## Stashing Git stash allows you to temporarily save your uncommitted changes and revert your working directory to a clean state. This is particularly useful when you need to quickly switch branches or pull updates without committing incomplete work.