Skip to content

Commit ddcd44c

Browse files
authored
Ai assistance page (#108)
* rename "virtual-branches" folder into "branch-management" So the URL will be not "virtual-branches/virtual-branches" but "branch-management/virtual-branches" * new ai-assistance page
1 parent 0b50eb4 commit ddcd44c

File tree

2 files changed

+134
-1
lines changed

2 files changed

+134
-1
lines changed
Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
---
2+
title: AI Assistance
3+
description: Let AI handle the busywork — generate branch names, commit messages, and pull request descriptions automatically in GitButler.
4+
---
5+
6+
## Getting Started
7+
8+
### Global AI Setup (One-time)
9+
10+
1. Navigate to **Global settings****AI Options**
11+
2. Choose your AI provider:
12+
- **GitButler API** (default): Uses OpenAI through GitButler's servers - no API key needed
13+
- **Your own key**: Bring your own OpenAI, Claude, Ollama, or LM Studio credentials
14+
3. If using your own key, enter your API credentials
15+
16+
### Per-Project Setup
17+
18+
1. Open **Project settings****AI options**
19+
2. Enable **"Enable branch and commit message generation"**
20+
3. Optionally enable **"Enable experimental AI features"** for advanced functionality
21+
22+
## Features
23+
24+
### Branch Name Generation
25+
26+
Automatically creates descriptive, kebab-case branch names based on your code changes.
27+
28+
**Usage:**
29+
30+
- Right-click on a branch header and select **Generate branch name**
31+
- GitButler analyzes commit messages in the branch and suggests an appropriate name
32+
- Generated names use kebab-case format and avoid conflicts with existing branches
33+
34+
### Commit Message Generation
35+
36+
Creates professional commit messages following best practices.
37+
38+
**Features:**
39+
40+
- Semantic prefixes (`feat:`, `fix:`, `refactor:`)
41+
- 50-character title limit, 72-character body wrap
42+
- Explains what changed and why
43+
- Real-time streaming as AI generates the message
44+
- Based on actual code diffs, not just file names
45+
46+
**Usage:**
47+
48+
1. Make changes to your files (staging is automatic in GitButler)
49+
2. Click the **Generate message** button in the commit message editor
50+
3. AI streams the generated message in real-time
51+
4. Review and edit before committing
52+
53+
**Example format:**
54+
55+
```
56+
feat: add user authentication system
57+
58+
Implements JWT-based authentication with login and registration
59+
endpoints. Includes password hashing and session management
60+
to secure user accounts.
61+
```
62+
63+
### Pull Request Descriptions
64+
65+
Generates comprehensive PR descriptions when creating pull requests.
66+
67+
**Usage:**
68+
69+
1. Create a pull request from your branch
70+
2. In the PR creation dialog, click **Generate PR description**
71+
3. AI analyzes all commits in your branch and generates a description
72+
4. Review and edit the generated content before creating the PR
73+
74+
**Generated content includes:**
75+
76+
- High-level summary based on commit messages
77+
- Structured description following PR templates (if configured)
78+
- Context derived from the changes in your branch
79+
80+
## Advanced Features
81+
82+
### Custom Prompts
83+
84+
- **Global Prompts**: Create custom prompts in **Global settings****AI Options**
85+
- **Project-Specific Prompts**: Assign specific prompts per project in **Project settings****AI options**
86+
- **Commit & Branch Prompts**: Separate customization for commit messages and branch names
87+
88+
## Configuration
89+
90+
### Global Settings (Global settings → AI Options)
91+
92+
- **AI Provider**: Choose between OpenAI, Anthropic, Ollama, or LM Studio
93+
- **Key Options**: Use GitButler API or bring your own credentials for each provider
94+
- **Model Selection**: Choose specific models per provider (GPT-4o, Claude Sonnet, etc.)
95+
- **Amount of provided context**: Set how many characters of git diff to send to AI
96+
97+
### Project Settings (Project settings → AI options)
98+
99+
- **Enable branch and commit message generation**: Master toggle for AI features in this project
100+
- **Enable experimental AI features**: Access to advanced AI functionality (requires GitButler API)
101+
- **Custom prompts**: Assign specific prompts from global settings to this project for commits and branches
102+
103+
## Troubleshooting
104+
105+
**AI features not working?**
106+
107+
1. **Check Global Settings**: Navigate to **Global settings****AI Options** and verify:
108+
- AI provider is configured (OpenAI, Anthropic, etc.)
109+
- Key option is selected (GitButler API or your own key)
110+
- If using your own key, ensure it's entered correctly
111+
- Model is selected for your chosen provider
112+
2. **Check Project Settings**: Open **Project settings****AI options** and ensure:
113+
- **"Enable branch and commit message generation"** is turned ON
114+
- This setting must be enabled for each project individually
115+
3. **Verify API Access**: Ensure sufficient API quota and valid credentials
116+
117+
**AI buttons not appearing?**
118+
119+
- The project-level toggle in **Project settings****AI options** controls button visibility
120+
- Without this enabled, Generate buttons won't appear in the UI
121+
122+
**Need better suggestions?**
123+
124+
- Customize prompt templates in **Global settings****AI Options**
125+
- Make meaningful code changes with clear patterns
126+
- Use descriptive variable names and comments in your code
127+
- Review [troubleshooting guide](https://docs.gitbutler.com/troubleshooting/custom-csp) for advanced configurations
128+
129+
## Related Documentation
130+
131+
- [AI Integration Overview](https://docs.gitbutler.com/features/ai-integration/ai-overview)
132+
- [MCP Server Setup](https://docs.gitbutler.com/features/ai-integration/mcp-server)

content/docs/features/branch-management/meta.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"integration-branch",
1010
"merging",
1111
"upstream-integration",
12-
"signing-commits"
12+
"signing-commits",
13+
"ai-assistance"
1314
]
1415
}

0 commit comments

Comments
 (0)