You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .cursor/commands/git.md
+16-11Lines changed: 16 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,17 +1,17 @@
1
1
---
2
-
description: Git manipulation rules
3
-
globs: *,**/*
4
-
alwaysApply: true
2
+
description: Git commit creation following conventional commits format
5
3
---
4
+
6
5
# Commit creation
7
6
8
-
- When asked to "commit":
9
-
1. Check staged files using `git diff --staged` and create a commit message using *only* the staged files.
10
-
- Once the message is ready, directly propose the commit command to the user.
11
-
2. If no files are staged, check the differences using `git status`, then stage files sequentially based on the following commit granularity before committing:
12
-
- Separate commits by package.
13
-
- Commit dependencies first (if dependency order is unclear, check using `npx lerna list --graph`).
14
-
- If the OS, application settings, or context suggest a language other than English is being used, provide a translation and explanation of the commit message in that language immediately before proposing the commit command to the user.
7
+
When asked to "commit":
8
+
9
+
1. Check staged files using `git diff --staged` and create a commit message using _only_ the staged files.
10
+
- Once the message is ready, directly propose the commit command to the user.
11
+
2. If no files are staged, check the differences using `git status`, then stage files sequentially based on the following commit granularity before committing:
12
+
- Separate commits by package.
13
+
- Commit dependencies first (if dependency order is unclear, check using `npx lerna list --graph`).
14
+
3. If the OS, application settings, or context suggest a language other than English is being used, provide a translation and explanation of the commit message in that language immediately before proposing the commit command to the user.
15
15
16
16
# Commit message format
17
17
@@ -38,20 +38,25 @@ alwaysApply: true
38
38
- Always use single quotes (') instead of double quotes (") for commit messages to avoid shell interpretation issues
39
39
- For breaking changes or complex commit messages:
40
40
- Option 1 (Recommended for complex messages): Use the git commit without -m flag to open an editor:
41
+
41
42
```
42
43
git commit
43
44
```
45
+
44
46
Then write your commit message in the editor with the proper format:
47
+
45
48
```
46
49
type(scope)!: subject line
47
50
48
51
BREAKING CHANGE: detailed explanation
49
52
- Additional details
50
53
- More information
51
54
```
55
+
52
56
- Option 2: For command line commits with breaking changes, use a simple format:
0 commit comments