Git LiveSync

Git LiveSync is a real-time Git merge conflict detector. It surfaces line-level editing presence directly in your VS Code editor before code is committed or pushed. Say goodbye to late-stage merge conflicts by knowing exactly who is editing what, right now.
🚀 Features
- Real-time Presence Tracking: See exactly which lines other developers are editing in real-time.
- Branch Isolation: Only warns you if another developer is editing the same repository but on a different branch.
- Frictionless Identity: Integrates with VS Code's GitHub authentication to display real teammate usernames.
- Blazing Fast Backend: Powered by the Bun runtime with native WebSocket Pub/Sub capabilities.
- Zero Config Local Fallback: Works on local repositories even without a remote URL configured.
- Smart Garbage Collection: Automatically cleans up "ghost" cursors if a developer goes idle or disconnects.
🏗️ Architecture
The system is split into two lightweight components:
git-livesync-client: A VS Code Extension (TypeScript). It debounces local edits and securely transmits them to the relay server.
git-livesync-server: A Node/Bun WebSocket Relay Server. It uses Bun's native C-level Pub/Sub engine to group connections by repository URL and broadcast edits efficiently.
🛠️ Getting Started
1. Hosting the Relay Server (Backend)
You can run the backend natively using Bun or via Docker. The easiest way to get started is using Docker Compose.
Using Docker Compose:
# Clone the repository
git clone <your-repo-url>
cd merge-conflict-detector
# Start the server in the background
docker compose up -d
The server will now be listening on ws://localhost:8080.
Using Bun (Native):
cd git-livesync-server
bun install
bun run start
2. Running the VS Code Extension (Client)
- Open the
git-livesync-client folder in VS Code.
- Run
npm install to install extension dependencies.
- Press
F5 to open a new Extension Development Host window.
- In the new window, open any Git repository.
- Have a teammate (or open a second VS Code window) open the same repository, switch to a different branch, and start typing.
- You will see warning markers (e.g.,
⚠️ Edited by User) appear next to the lines being actively edited!
🔒 Production Deployment
To deploy the relay server to production (e.g., Railway, Render, or an AWS VPS):
- Use
wss:// (Secure WebSockets): Make sure you place the Docker container behind a reverse proxy (like Nginx) that handles SSL termination. VS Code requires secure sockets in production environments.
- Update Client URL: Change the hardcoded
ws://localhost:8080 in git-livesync-client/src/extension.ts to your production URL (e.g., wss://livesync.yourdomain.com).
🤝 Contributing
Pull requests are welcome! For major changes, please open an issue first to discuss what you would like to change.