A VS Code extension to watch for file changes and automatically sync them to the configured Git remote.
- Automatic Git Commits: Automatically commits changes to the repository whenever files are modified or created, ignoring files that are excluded in the
.gitignore
. - Customizable Commit Delay: Configure the delay between commits through settings.
To install the Git Live Sync extension, follow these steps:
- Clone this repository:
git clone https://github.com/bwfiq/git-livesync
cd git-livesync
- Install dependencies:
npm install
- Build the extension:
vsce package
- Install the .vsix file in Visual Studio Code:
- Open VS Code and go to the "Extensions" view (Ctrl+Shift+X).
- Click on the three dots in the upper right corner and select "Install from VSIX..."
- Select the generated .vsix file.
- Open your project in Visual Studio Code.
- Configure the extension by adding settings in your
settings.json
file. For example:{ "git-livesync.commitDelay": 30, "git-livesync.enabled": true }
- The extension will now watch for file changes and commit them automatically.
Key | Type | Description |
---|---|---|
git-livesync.enabled |
Boolean | CAUTION: DO NOT ENABLE THIS FOR USER UNLESS YOU KNOW WHAT YOU ARE DOING! Specifies whether to enable this extension in the current workspace. Default is false . |
git-livesync.autoPull |
Boolean | Enables automatically pulling from the current branch after a delay configured by git-livesync.autoPullDelay . Default is true . |
git-livesync.autoPullDelay |
Integer | If git-livesync.autoPull is enabled, automatically pulls from the remote branch every X seconds. Default is 5 seconds. |
git-livesync.autoCommitAndSync |
Boolean | Enables automatically committing to the remote branch after a delay configured by git-livesync.autoCommitAndSyncDelay . Default is true . |
git-livesync.autoCommitAndSyncDelay |
Integer | If git-livesync.autoCommitAndSync is enabled, automatically commits to the remote branch on a file change if it is X seconds after the last commit. Default is 30 seconds. |
To set up a development environment for the Git Live Sync extension, follow these steps:
-
Clone the repository:
git clone <repository-url> cd git-livesync
-
Install dependencies:
npm install
-
Open the project in Visual Studio Code.
-
Build the extension:
npm run build
-
Launch the Extension:
- Press
F5
to run the extension in a new Extension Development Host instance of VS Code.
- Press
- Benchmark and remove any slowdowns
- Add a setting to adjust pull and push behaviour instead of always syncing on commit
- Add error handling for if workspace doesn't have
.git/
or.gitignore
Contributions to the Git Live Sync extension are welcome! Please follow these guidelines:
- Fork the repository.
- Create a feature branch (
git checkout -b feature/YourFeature
). - Commit your changes (
git commit -m 'Add some feature'
). - Push to the branch (
git push origin feature/YourFeature
). - Open a pull request.
This project is licensed under the GNU AGPL v3 License - see the LICENSE file for details.
- This extension utilizes simple-git and ignore for Git operations.
- There is no cooldown. It will spam commits for every single tiny change.
- The cooldown is hardcoded to 5 seconds. There is no setting for it.
- There are no workspace-specific settings. It will watch every single opened folder.
- The terminals created are spammed like crazy.
- You need to run a command from the palette to activate the extension.
- It is not packaged as a .vsix file yet.
- There is no error checking for if the workspace is a git repository or not.
- There is no error checking for if a .gitignore exists.