1 unstable release

0.1.0 Mar 4, 2024

#2952 in Command line utilities

MIT/Apache

9KB
136 lines

Git Status

License

A command-line utility written in Rust to display the status of Git repositories in folders. And allows to auto commit and push unclean repos.

Git Helper in Rust

This project provides a set of utility functions to interact with Git using Rust. Feel free to contribute.

Functions

is_git_installed() -> bool

This function checks if Git is installed on the system by running the git --version command.

is_git_repo(path: &std::path::Path) -> bool

This function checks if the given path is inside a Git repository by running the git rev-parse --is-inside-work-tree command in the given directory.

check_git_status(path: &std::path::Path)

This function checks the status of the Git repository at the given path by running the git status command. If there are changes, it prompts the user to add, commit, and push the changes.

add_commit_push(path: &std::path::Path)

This function adds all changes, commits them with the message "auto commit", and pushes them to the remote repository. It runs the git add ., git commit -m "auto commit", and git push commands in the given directory.

Features

  • Loops through root folder passed as function and detects all git repos
  • Allows users to auto-commit and push unclean repos
  • Show the number of modified, added, deleted, and renamed files
  • Show the number of untracked files

Usage

git_status [root folder]

Contact

Dependencies

~0–9.5MB
~43K SLoC