Project

repo_tools

0.0
No commit activity in last 3 years
No release in over 3 years
Smartly manage cloned Git repos in your project. For example, only clone the repo if it's behind the latest master commit.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 1.10
~> 10.0
>= 0
 Project Readme

RepoTools

The RepoTools gem can be used to clone Git repositories into a local application and only reclone the Git repository when it is behind origin/master.

Usage

The following code will clone the frontend-generators in the /root/path/tmp/test/frontend-generators directory:

puller = RepoTools::Puller.new("git@github.com:MrPowers/frontend-generators.git", "/root/path", "test")
puller.clean_and_clone

If origin/master stays the same and you run #clean_and_clone again, the repo will not be cloned again (because cloning is an expensive operation).

If origin/master is updated, then the repo will be re-cloned. This code will cause the repo to be re-cloned for example:

cd /root/path/tmp/test/frontend-generators
git reset --hard HEAD~4
puller = RepoTools::Puller.new("git@github.com:MrPowers/frontend-generators.git", "/root/path", "test")
puller.clean_and_clone

Installation

Add this line to your application's Gemfile:

gem 'repo_tools'

And then execute:

$ bundle

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/MrPowers/repo_tools.

License

The gem is available as open source under the terms of the MIT License.