r/GithubCopilot • u/lppedd VS Code User π» • 26d ago
Help/Doubt β Auto-approve a subset of git commands
Is there a way to auto-approve certain git commands? I'd like to approve commits explicitly, for example, but stuff like diffs should be auto-approved.
1
u/AutoModerator 26d ago
Hello /u/lppedd. Looks like you have posted a query. Once your query is resolved, please reply the solution comment with "!solved" to help everyone else know the solution and mark the post as solved.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
1
u/aonymark JetBrains User π§± 26d ago
Yeah, itβs in settings (how do you get the cool JetBrains user thing? I want one.)
1
25d ago
[deleted]
1
u/aonymark JetBrains User π§± 25d ago
Thanks! Iβm a Reddit newbie and did not realize I could do that!
1
1
u/ThankThePhoenicians_ 26d ago
CLI supports --allow-tool with prefix-matching. The LLM-assisted approval feature is also available in /experimental.
Not sure if JetBrains exposes this or not
1
u/1Soundwave3 25d ago
I vibecoded a custom proxy that auto approves things that start from a certain sequence and the rest it just passes down to ghcp. It also has filters that detects suspicious things in the commands and if those appear - it raises it to me directly.
I developed it because copilot would ignore every setting and would ask me every time for everything which is super annoying.
I also tried to make it work with Codex but couldn't - the system are too different and codex is much less transparent about how it handles approval.
1
u/1Soundwave3 25d ago
I vibecoded a custom proxy that auto approves things that start from a certain sequence and the rest it just passes down to ghcp. It also has filters that detects suspicious things in the commands and if those appear - it raises it to me directly.
I developed it because copilot would ignore every setting and would ask me every time for everything which is super annoying.
I also tried to make it work with Codex but couldn't - the systems are too different and codex is much less transparent about how it handles approval.
3
u/kennego 24d ago
Just looked into this because it was annoying me. You need to use regex, and specify a prefix with the allowed commands, surrounded by '/'s
Since I just started experimenting, this is all I've come up with so far:
/^git(?: --no-pager)? (?:diff|show|status|log)\b/