GitSource is a Rust CLI tool designed to manage versioning and synchronization of Git repositories. The tool automates fetching and updating Git repositories, comparing version information, and more.
init: Initializes agitSource.jsonfile that contains information about the Git repository, including username, repo name, branch, and version. If the file already exists, it will skip the initialization.update: Increments the version number by updating the patch version (e.g., from0.0.1to0.0.2).update-major: Increments the major version number (e.g., from0.7.2to1.0.0).fetch: Compares the local version with the remote version fetched from GitHub, and runsgit fetchif the remote version is newer.
cargo install gitSource@0.0.1Use the init subcommand to create a gitSource.json file. If the file already exists, it won't prompt for input.
gs initUse the update subcommand to increment the patch version:
gs updateFor example, this will change the version from 0.0.1 to 0.0.2.
Use the update-major subcommand to increment the major version:
gs update-majorFor example, this will change the version from 0.7.2 to 1.0.0.
Use the fetch subcommand to compare the local version with the remote version. If the remote version is newer, it will automatically fetch the updates:
gs fetchTo install GitSource, follow these steps:
- Install rust:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
- Verify that rust and cargo is installed by running:
rustc --version
cargo --version- Run the installation script:
cargo install gitSource@0.0.1- Use the cli:
gs [argument]- Clone the repository:
git clone https://github.com/yourusername/gitsource.git- Navigate to the project directory:
cd gitsource- Build the project:
cargo build --release- Install the binary globally:
sudo mv target/release/gs /usr/local/bin/Now, you can use the gs command from anywhere on your system.
Contributions are welcome! Feel free to fork the repository and submit pull requests.
This project is licensed under the MIT License - see the LICENSE file for details.