๐ ๏ธ Git Sync CLI
A lightweight Rust-based CLI tool to automate common Git tasks such as detecting the repository root, checking status, pulling, committing, and pushing changes โ all in a clean, user-friendly terminal interface.
๐ Features
- ๐ Automatically finds the root of a Git repository.
- ๐๏ธ Displays the repository name and path.
- โ
Checks repository status (
git status -sb
). - โฌ๏ธ Pulls the latest changes from the remote.
- ๐ฆ Detects uncommitted changes and stages them.
- โ๏ธ Prompts for a commit message.
- โฌ๏ธ Pushes commits to the remote (with optional GitHub token support).
- ๐ Checks for internet connectivity before pushing.
๐งฑ Requirements
- Rust
- Git installed and configured.
- (Optional) Set a GitHub token as an environment variable for private repositories:
export GITHUB_TOKEN=your_token_here
##Global Installation
To make the tool globally available:
|
Usage
Simply run the program in any folder containing a Git repository:
syncgit
๐งช Usage
Run the tool from anywhere inside a Git repository:
Sample Flow:
- Finds the
.git
root directory. - Displays repository path and name.
- Shows Git status.
- Pulls changes from remote.
- Detects and stages modified or untracked files.
- Prompts for a commit message.
- Commits and pushes the changes.
๐ Offline Mode
If no internet connection is detected, changes are committed locally but not pushed. A message will inform you to push manually once online.
๐ GitHub Token Authentication
To push to private GitHub repositories via HTTPS, the tool will use the GITHUB_TOKEN
environment variable (if available) to authenticate securely by rewriting the remote URL temporarily.
๐ Dependencies
term_size
: For responsive terminal layout.- Standard Rust
std::process
,std::io
,std::env
, andstd::net
.
๐ค Contributions
Pull requests and feedback are welcome! Please open an issue first to discuss any major changes.
Made with โค๏ธ in Rust.