git_status

Crates.iogit_status
lib.rsgit_status
version0.1.0
sourcesrc
created_at2024-03-04 07:57:42.263484
updated_at2024-03-04 07:57:42.263484
descriptionA tool to git status automation
homepagehttps://github.com/Kratosgado/git_status
repositoryhttps://github.com/Kratosgado/git_status
max_upload_size
id1161355
size11,034
Prince Mbeah Essilfie (Kratosgado)

documentation

README

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

Commit count: 0

cargo fmt