syncgit 0.1.5

Una herramienta CLI para sincronizar repositorios Git
syncgit-0.1.5 is not a library.

๐Ÿ› ๏ธ 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).
  • โš ๏ธ NEW: Detects pending pushes to prevent duplicate commits.
  • โฌ‡๏ธ 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.
  • ๐Ÿ”„ Lists child Git repositories when not in a Git repo.

๐Ÿงฑ 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:

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
cargo install syncgit 

Usage

Simply run the program in any folder containing a Git repository:

syncgit

๐Ÿงช Usage

Run the tool from anywhere inside a Git repository:

sync-git

Sample Flow:

  1. Finds the .git root directory.
  2. Displays repository path and name.
  3. Shows Git status.
  4. NEW: Checks for pending pushes and warns if commits need to be pushed first.
  5. Pulls changes from remote.
  6. Detects and stages modified or untracked files.
  7. Prompts for a commit message.
  8. 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, and std::net.

๐Ÿค Contributions

Pull requests and feedback are welcome! Please open an issue first to discuss any major changes.

Made with โค๏ธ in Rust.