https://github.com/rewindio/gitfetch
Concurrently clone/fetch/push to (remote) git repositories
https://github.com/rewindio/gitfetch
backup github
Last synced: 11 months ago
JSON representation
Concurrently clone/fetch/push to (remote) git repositories
- Host: GitHub
- URL: https://github.com/rewindio/gitfetch
- Owner: rewindio
- License: mit
- Created: 2016-04-22T15:14:15.000Z (about 10 years ago)
- Default Branch: main
- Last Pushed: 2023-01-12T19:56:38.000Z (over 3 years ago)
- Last Synced: 2023-03-02T22:56:11.902Z (over 3 years ago)
- Topics: backup, github
- Language: C
- Homepage: http://backhub.co
- Size: 60.5 KB
- Stars: 1
- Watchers: 20
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# gitfetch
Clone/fetch (or push to) git repositories.
All method calls are non-blocking, so cloning/fetching/pushing multiple
repositories concurrently is possible using Threads.
Supports GitHub authentication tokens for remote repositories using HTTP basic auth.
## Documentation
API docs, see here: https://rubydoc.info/gems/gitfetch
## Installation
place
```ruby
gem 'gitfetch'
```
in your `Gemfile` and execute
```
bundle install
```
## Usage
```ruby
require 'gitfetch'
# Git.fetch(repository, access_token=nil, update_head=false)
# connects to remote "origin" of +repository_path+ using +access_token+ as
# username for authentication:
#
# - prunes tracking refs that are no longer present on remote
# - downloads new data and update tips
#
# example:
Git.fetch('repository.git', '6a61e7dddd28c...')
# Git.mirror(remote_url, path, access_token)
# Set up a (bare) mirror of the remote repository.
# example:
Git.mirror('https://github.com/octokit/Spoon-Knife.git', '/data/git/Spoon-Knife.git', '6a61e7dddd28c...')
# Git.push(repository_path, push_url, access_token)
# Pushes local repository to remote push_url
# example:
Git.push('/data/git/repository.git', 'https://github.com/backhub/new_repository.git', '6a61e7dddd28c...')
# Git.libgit2_version
# Returns the version String of libgit2
# example:
Git.libgit2_version
```
## Why
*gitfetch* was built @[BackHub](https://backhub.co) because we needed a tool to backup GitHub
repositories. We use [Sidekiq](https://sidekiq.org) for running jobs in multiple threads.
[rugged](https://github.com/libgit2/rugged) is not thread-safe/blocking background threads.
*gitfetch* features a simple API (clone/fetch/push) and can run in multiple threads concurrently.
---
made with :heart: by Christian Schlack@[BackHub](https://backhub.co)