1 unstable release
0.0.1 | Oct 3, 2024 |
---|
#20 in #increment
21KB
352 lines
GitSource
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.
Features
init
: Initializes agitSource.json
file 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.1
to0.0.2
).update-major
: Increments the major version number (e.g., from0.7.2
to1.0.0
).fetch
: Compares the local version with the remote version fetched from GitHub, and runsgit fetch
if the remote version is newer.
Quick Install
cargo install gitSource@0.0.1
Usage
1. Initialize gitSource.json
Use the init
subcommand to create a gitSource.json
file. If the file already exists, it won't prompt for input.
gs init
2. Update Version
Use the update
subcommand to increment the patch version:
gs update
For example, this will change the version from 0.0.1
to 0.0.2
.
3. Update Major Version
Use the update-major
subcommand to increment the major version:
gs update-major
For example, this will change the version from 0.7.2
to 1.0.0
.
4. Fetch Remote Version
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 fetch
Installation
To 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]
If you wish to manually build the program:
- 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
Contributions are welcome! Feel free to fork the repository and submit pull requests.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Dependencies
~5–17MB
~232K SLoC