Gitter is a lightweight and efficient tool written in TypeScript that automates git repository management. Its primary functionality includes real-time file monitoring and automatic commits for changes in a repository, making it perfect for maintaining codebases with minimal manual intervention.
Gitter simplifies your workflow by:
- Monitoring changes in a git repository.
- Automatically committing and pushing updates after a specified period of inactivity.
- Reducing the risk of losing work due to forgotten commits.
-
Automatic Commit and Push:
- Detects changes in the monitored repository.
- Auto-commits with a timestamped message and pushes the changes to the remote repository.
-
Customizable Timeout:
- Specify an inactivity timeout (in seconds) after which changes are auto-committed.
-
Real-time Monitoring:
- Utilizes file system watchers to track changes in real-time.
-
User-friendly Command-line Interface:
- Pass repository path and timeout duration as command-line arguments.
- TypeScript: Provides a strongly-typed development experience.
- Node.js: Powers the file system operations and command-line tooling.
- simple-git: A lightweight interface for Git commands.
- Node.js (LTS version recommended)
- Git installed on your system.
- Clone the repository:
git clone https://github.com/DavidMANZI-093/Gitter.git
- Navigate to the project directory:
cd Gitter
- Install dependencies:
npm install
Run the tool by providing the repository path and timeout in seconds:
npx ts-node src/gitter.ts <path-to-repo> <timeout-in-seconds>
Example:
npx ts-node src/gitter.ts /path/to/repo 60
-
Command-line Input Handling:
- The
src/assets/cmd.ts
module processes the command-line arguments (repository path and timeout).
- The
-
Repository Initialization:
- The
src/assets/git.ts
module initializes a git repository instance for the provided path.
- The
-
File Monitoring:
- The
src/assets/watcher.ts
module uses Node.js'sfs.watch
to monitor file changes.
- The
-
Auto-commit Logic:
- The
src/assets/commit.ts
module handles the auto-commit and push operations.
- The
-
Main Script:
- The
src/gitter.ts
file ties everything together, initializing the watcher and handling errors gracefully.
- The
We welcome contributions to improve Gitter! Feel free to:
- Fork the repository.
- Create a new branch for your feature:
git checkout -b feature-name
- Make your changes and commit them:
git commit -m "Add your message here"
- Push to your branch:
git push origin feature-name
- Open a pull request.
This project is licensed under the MIT License. Feel free to use, modify, and distribute it as per the terms of the license.
For any questions or suggestions, feel free to reach out:
- Author: DavidMANZI-093
- Email: manzidavid093@gmail.com