2626 <practice >Chain git commands with && for efficiency</practice >
2727 <practice >Use --format options for structured output</practice >
2828 <practice >Capture command output for parsing</practice >
29+ <practice >Use GIT_EDITOR=true for non-interactive git rebase operations</practice >
30+ <practice >Set environment variables inline to avoid prompts during automation</practice >
2931 </best_practices >
3032
3133 <common_commands >
4648
4749 <command >
4850 <purpose >Rebase onto main to reveal conflicts</purpose >
49- <syntax >git rebase origin/main</syntax >
51+ <syntax >GIT_EDITOR=true git rebase origin/main</syntax >
5052 </command >
5153
5254 <command >
7173
7274 <command >
7375 <purpose >Continue rebase after resolution</purpose >
74- <syntax >git rebase --continue</syntax >
76+ <syntax >GIT_EDITOR=true git rebase --continue</syntax >
7577 </command >
7678 </common_commands >
7779 </tool >
@@ -152,7 +154,7 @@ const config = {
152154 <step >execute_command - Get PR info with gh CLI</step >
153155 <step >execute_command - Checkout PR with gh pr checkout --force</step >
154156 <step >execute_command - Fetch origin main</step >
155- <step >execute_command - Rebase onto origin/main</step >
157+ <step >execute_command - Rebase onto origin/main with GIT_EDITOR=true </step >
156158 <step >execute_command - Check for conflicts with git status</step >
157159 </sequence >
158160 </pattern >
@@ -178,13 +180,22 @@ const config = {
178180 <pattern name =" complete_rebase" >
179181 <sequence >
180182 <step >execute_command - Check all conflicts resolved</step >
181- <step >execute_command - Continue rebase with git rebase --continue</step >
183+ <step >execute_command - Continue rebase with GIT_EDITOR=true git rebase --continue</step >
182184 <step >execute_command - Verify clean status</step >
183185 </sequence >
184186 </pattern >
185187 </tool_combination_patterns >
186188
187189 <error_handling >
190+ <scenario name =" interactive_prompt_blocking" >
191+ <description >Git commands waiting for interactive input</description >
192+ <approach >
193+ Use GIT_EDITOR=true to bypass editor prompts
194+ Set GIT_SEQUENCE_EDITOR=true for sequence editing
195+ Consider --no-edit flag for commit operations
196+ </approach >
197+ </scenario >
198+
188199 <scenario name =" no_conflicts_after_rebase" >
189200 <description >Rebase completes without conflicts</description >
190201 <approach >
@@ -225,4 +236,42 @@ const config = {
225236 </approach >
226237 </scenario >
227238 </error_handling >
239+
240+ <non_interactive_operations >
241+ <overview >
242+ Ensuring git operations run without requiring user interaction is critical
243+ for automated conflict resolution. The mode uses environment variables to
244+ bypass interactive prompts.
245+ </overview >
246+
247+ <techniques >
248+ <technique name =" GIT_EDITOR" >
249+ <description >Set to 'true' (a no-op command) to skip editor prompts</description >
250+ <usage >GIT_EDITOR=true git rebase --continue</usage >
251+ <when >During rebase operations that would normally open an editor</when >
252+ </technique >
253+
254+ <technique name =" GIT_SEQUENCE_EDITOR" >
255+ <description >Skip interactive rebase todo editing</description >
256+ <usage >GIT_SEQUENCE_EDITOR=true git rebase -i HEAD~3</usage >
257+ <when >When interactive rebase is triggered but no editing needed</when >
258+ </technique >
259+
260+ <technique name =" commit_flags" >
261+ <description >Use flags to avoid interactive prompts</description >
262+ <examples >
263+ <example >git commit --no-edit (use existing message)</example >
264+ <example >git merge --no-edit (skip merge message editing)</example >
265+ <example >git cherry-pick --no-edit (keep original message)</example >
266+ </examples >
267+ </technique >
268+ </techniques >
269+
270+ <best_practices >
271+ <practice >Always test commands locally first to identify potential prompts</practice >
272+ <practice >Combine environment variables when multiple editors might be invoked</practice >
273+ <practice >Document why non-interactive mode is used in comments</practice >
274+ <practice >Have fallback strategies if automation fails</practice >
275+ </best_practices >
276+ </non_interactive_operations >
228277</merge_resolver_tool_usage >
0 commit comments