<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Mohamed idhrish</title>
    <description>The latest articles on DEV Community by Mohamed idhrish (@mohamed_idhrish_07).</description>
    <link>https://dev.to/mohamed_idhrish_07</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3865127%2F88ed8843-e1eb-415b-936f-44302a2516c7.png</url>
      <title>DEV Community: Mohamed idhrish</title>
      <link>https://dev.to/mohamed_idhrish_07</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mohamed_idhrish_07"/>
    <language>en</language>
    <item>
      <title>🦇 A Real Git Conflict Inspired Me to Build This Node.js CLI Tool</title>
      <dc:creator>Mohamed idhrish</dc:creator>
      <pubDate>Wed, 09 Sep 2026 05:02:58 +0000</pubDate>
      <link>https://dev.to/mohamed_idhrish_07/a-real-git-conflict-inspired-me-to-build-this-nodejs-cli-tool-3d8d</link>
      <guid>https://dev.to/mohamed_idhrish_07/a-real-git-conflict-inspired-me-to-build-this-nodejs-cli-tool-3d8d</guid>
      <description>&lt;p&gt;Have you ever pulled changes from GitHub and suddenly ended up with a merge conflict?&lt;/p&gt;

&lt;p&gt;You see something like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt; HEAD
your changes
=======
someone else's changes
&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; origin/main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And then the real question starts:&lt;/p&gt;

&lt;p&gt;Which change should I keep?&lt;/p&gt;

&lt;p&gt;That question is what inspired me to build Batman Git CLI Assistant.&lt;/p&gt;

&lt;p&gt;💡 How the idea started&lt;/p&gt;

&lt;p&gt;This project came from a real situation in my office.&lt;/p&gt;

&lt;p&gt;Two developers were working on the same project and the same Git branch.&lt;/p&gt;

&lt;p&gt;One developer changed a file and pushed the changes to GitHub.&lt;/p&gt;

&lt;p&gt;Meanwhile, the other developer had also modified the same file locally.&lt;/p&gt;

&lt;p&gt;When they tried to synchronize their work, Git reported a conflict.&lt;/p&gt;

&lt;p&gt;The problem wasn't that Git didn't provide a solution.&lt;/p&gt;

&lt;p&gt;The problem was understanding:&lt;/p&gt;

&lt;p&gt;What changed locally?&lt;br&gt;
What changed remotely?&lt;br&gt;
Which changes should be kept?&lt;br&gt;
What is safe to do next?&lt;br&gt;
How can we resolve the conflict without accidentally losing work?&lt;/p&gt;

&lt;p&gt;That experience made me think:&lt;/p&gt;

&lt;p&gt;What if there was a simple helper that could guide developers through these situations?&lt;/p&gt;

&lt;p&gt;And that's how Batman Git CLI Assistant started.&lt;/p&gt;

&lt;p&gt;🦇 What is Batman Git CLI Assistant?&lt;/p&gt;

&lt;p&gt;Batman is a lightweight Node.js CLI tool that works as a safety and automation layer around normal Git commands.&lt;/p&gt;

&lt;p&gt;The goal isn't to replace Git.&lt;/p&gt;

&lt;p&gt;Instead, it tries to make difficult Git workflows:&lt;/p&gt;

&lt;p&gt;Understandable → Safer → Easier to manage&lt;/p&gt;

&lt;p&gt;It still uses Git underneath. Batman simply helps the developer understand what's happening and perform common operations more safely.&lt;/p&gt;

&lt;p&gt;🤖 Why not just use AI?&lt;/p&gt;

&lt;p&gt;AI can be very useful for Git.&lt;/p&gt;

&lt;p&gt;It can explain a merge conflict, analyze code, and suggest a possible resolution.&lt;/p&gt;

&lt;p&gt;But there is an important limitation:&lt;/p&gt;

&lt;p&gt;AI doesn't always know the developer's actual intention.&lt;/p&gt;

&lt;p&gt;For example, if two developers changed the same piece of code, an AI might suggest a technically valid resolution.&lt;/p&gt;

&lt;p&gt;But the developer still needs to decide:&lt;/p&gt;

&lt;p&gt;"Which change is actually correct for my project?"&lt;/p&gt;

&lt;p&gt;That's why I wanted Batman to focus on visibility, safety checks, and developer control rather than automatically making every decision.&lt;/p&gt;

&lt;p&gt;⚡ What can Batman do?&lt;/p&gt;

&lt;p&gt;Some of the current commands include:&lt;/p&gt;

&lt;p&gt;batman safe-push&lt;/p&gt;

&lt;p&gt;Helps perform a safer push workflow by checking the repository state, synchronizing changes, handling conflicts, and performing safety checks before pushing.&lt;/p&gt;

&lt;p&gt;batman safe-push "Add new feature"&lt;br&gt;
batman conflict&lt;/p&gt;

&lt;p&gt;Helps inspect the current conflict situation and understand local vs incoming changes.&lt;/p&gt;

&lt;p&gt;batman conflict&lt;br&gt;
batman resolve&lt;/p&gt;

&lt;p&gt;Provides an interactive way to choose which version of a conflicting change should be used.&lt;/p&gt;

&lt;p&gt;batman resolve&lt;br&gt;
batman continue&lt;/p&gt;

&lt;p&gt;Helps continue an interrupted Git operation after conflicts have been resolved.&lt;/p&gt;

&lt;p&gt;batman continue&lt;br&gt;
batman scan&lt;/p&gt;

&lt;p&gt;Scans the project for potentially dangerous files or content such as:&lt;/p&gt;

&lt;p&gt;.env files&lt;br&gt;
private keys&lt;br&gt;
possible secrets&lt;br&gt;
unusually large files&lt;br&gt;
batman scan&lt;br&gt;
batman squash&lt;/p&gt;

&lt;p&gt;Helps combine multiple local commits before synchronization or rebasing.&lt;/p&gt;

&lt;p&gt;batman squash&lt;br&gt;
batman rescue&lt;/p&gt;

&lt;p&gt;Creates a safety backup before potentially destructive operations.&lt;/p&gt;

&lt;p&gt;batman rescue&lt;br&gt;
batman verify&lt;/p&gt;

&lt;p&gt;Runs available project verification/build/test commands.&lt;/p&gt;

&lt;p&gt;batman verify&lt;br&gt;
batman sub-sync&lt;/p&gt;

&lt;p&gt;Helps synchronize Git submodules.&lt;/p&gt;

&lt;p&gt;batman sub-sync&lt;/p&gt;

&lt;p&gt;And there's also:&lt;/p&gt;

&lt;p&gt;batman help&lt;/p&gt;

&lt;p&gt;to explore the available commands.&lt;/p&gt;

&lt;p&gt;🛠️ Tech Stack&lt;/p&gt;

&lt;p&gt;Batman is built using:&lt;/p&gt;

&lt;p&gt;JavaScript&lt;br&gt;
Node.js&lt;br&gt;
Git&lt;br&gt;
NPM&lt;br&gt;
Chalk — terminal styling&lt;br&gt;
Boxen — terminal UI&lt;br&gt;
Node.js APIs — command execution, file handling, and interactive prompts&lt;/p&gt;

&lt;p&gt;The project is distributed as an NPM package.&lt;/p&gt;

&lt;p&gt;📦 Installation&lt;/p&gt;

&lt;p&gt;You can install Batman globally with:&lt;/p&gt;

&lt;p&gt;npm install -g batman-commands&lt;/p&gt;

&lt;p&gt;Then run:&lt;/p&gt;

&lt;p&gt;batman help&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;p&gt;batman safe-push "Add login validation"&lt;/p&gt;

&lt;p&gt;or:&lt;/p&gt;

&lt;p&gt;batman conflict&lt;br&gt;
🎯 What I'm trying to achieve&lt;/p&gt;

&lt;p&gt;The main idea behind Batman is simple:&lt;/p&gt;

&lt;p&gt;Git is powerful, but sometimes the workflow around Git can be confusing.&lt;/p&gt;

&lt;p&gt;I want Batman to help developers understand what is happening before they execute potentially risky Git operations.&lt;/p&gt;

&lt;p&gt;It shouldn't replace Git.&lt;/p&gt;

&lt;p&gt;It shouldn't replace the developer.&lt;/p&gt;

&lt;p&gt;It should work alongside both.&lt;/p&gt;

&lt;p&gt;Think of it as a small Git sidekick. 🦇&lt;/p&gt;

&lt;p&gt;🚀 What's next?&lt;/p&gt;

&lt;p&gt;Batman Git CLI Assistant is still a work in progress.&lt;/p&gt;

&lt;p&gt;I'm planning to improve areas such as:&lt;/p&gt;

&lt;p&gt;Better conflict visualization&lt;br&gt;
More safety checks&lt;br&gt;
Better Git workflow detection&lt;br&gt;
More recovery options&lt;br&gt;
Improved developer experience&lt;br&gt;
Better documentation&lt;br&gt;
More cross-platform testing&lt;/p&gt;

&lt;p&gt;I'd also like to hear from other developers.&lt;/p&gt;

&lt;p&gt;What Git problem do you find confusing or risky?&lt;/p&gt;

&lt;p&gt;Is it:&lt;/p&gt;

&lt;p&gt;Merge conflicts?&lt;br&gt;
Rebasing?&lt;br&gt;
Resetting?&lt;br&gt;
Stashing?&lt;br&gt;
Accidental commits?&lt;br&gt;
Force pushing?&lt;br&gt;
Git history?&lt;br&gt;
Something else?&lt;/p&gt;

&lt;p&gt;I'd love to hear your experience and ideas.&lt;/p&gt;

&lt;p&gt;🔗 Try it&lt;/p&gt;

&lt;p&gt;NPM Package:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.npmjs.com/package/batman-commands" rel="noopener noreferrer"&gt;https://www.npmjs.com/package/batman-commands&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you try it, I'd really appreciate your feedback, suggestions, issues, or ideas.&lt;/p&gt;

&lt;p&gt;This project started from a real Git problem, and I'm hoping to turn it into a useful tool for other developers too.&lt;/p&gt;

&lt;p&gt;Real problem → Real workflow → Real solution. 🦇&lt;/p&gt;

&lt;h1&gt;
  
  
  Git #GitHub #NodeJS #JavaScript #NPM #CLI #DeveloperTools #OpenSource #GitConflict #SoftwareDevelopment
&lt;/h1&gt;

</description>
      <category>github</category>
      <category>git</category>
      <category>gitconflict</category>
      <category>cli</category>
    </item>
  </channel>
</rss>
