Demo, all content is generated
Question

My git history is 300 commits called 'wip', how often should I commit with AI?

Solved · 262 views · asked by pooja_s · edited

I commit whenever Cursor finishes something because people said to "commit often". Now my history is useless, all 'wip' or 'fix'. When I wanted to find where a bug came in I couldn't.

What's the right rhythm?

What I’ve tried

Tried writing better messages but after 5 prompts I'm lazy again.

Comment

3 answers

Marked as helpful by the asker
ximena_c · edited

Commit often locally is right; the history people read is a different thing. Rhythm that works:

  • One branch per feature: git switch -c feat/export-csv.
  • Commit every time it works (wip is fine there).
  • Merge to main with squash, with one proper message: "Add CSV export of filtered bookings". Main now reads like a changelog, and git bisect or blame gets you to one feature.

And let the AI write the messages: "commit the staged changes with a message describing what changed and why." Cursor's source control panel also has a generate-message button.

Comment
Squash merge was the missing piece, didn't know that was a thing. pooja_s · edited
+1 on squash. Also delete the branch after merging so the list stays short. kofi_mensah · edited
kofi_mensah · edited

Rule of thumb I use: commit when the app is in a state I'd be happy to return to. Not after every prompt; after every working prompt.

Comment
wes_codes · edited

If you want a format for the messages: conventional commits (feat:, fix:, refactor:). Easy for the AI to follow and makes history scannable.

Comment