docs: Add configuration explanation in git section (#43637)

Closes https://github.com/zed-industries/zed/issues/33441

Release Notes:

- Added configuration documentation for git-commit settings including preferred-line-length in the git panel

---------

Co-authored-by: Jakub Konka <kubkon@jakubkonka.com>
This commit is contained in:
Matthew Chisolm
2025-11-28 13:26:54 +00:00
committed by GitHub
co-authored by Jakub Konka
parent c18481ed13
commit 478bcea6d3
+23
View File
@@ -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. 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 ## 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. 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. 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. 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 ## 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. 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.