Skip to content
This repository has been archived by the owner on Jun 24, 2020. It is now read-only.

obfusk/gitbak

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
bin
 
 
lib
 
 
 
 
 
 
 
 

[]: {{{1

File        : README
Maintainer  : Felix C. Stegerman <flx@obfusk.net>
Date        : 2014-10-29

Copyright   : Copyright (C) 2014  Felix C. Stegerman
Version     : v0.5.2

[]: }}}1

Gem Version

Description

gitbak - bitbucket/github/gist backup

GitBak mirrors Bitbucket/GitHub/Gist repositories; paths, users, and other options are specified in ~/.gitbak.

When run, gitbak:

  • asks for passwords;
  • lists repositories using APIs - authenticating if necessary;
  • clones/updates repositories;
  • shows a summary (if verbose)

Usage

$ gitbak --help                                     # show options
$ vim ~/.gitbak                                     # configure
$ gitbak --no-act                                   # dry run
$ gitbak -v                                         # mirror
$ time gitbak -v 2>&1 | tee "$(date +%Y%m%d)".log   # w/ logfile

Installing

$ gem install gitbak                                # rubygems

Get it at https://github.com/obfusk/gitbak. Depends: git, ruby.

Configuration

Example

# ~/.gitbak
dir = "#{ Dir.home }/__mirror__/#{ Time.new.strftime '%Y%m%d' }"
%w{ bob alice }.each do |u|
  bitbucket  "#{dir}/#{u}/bitbucket", user: u
  github     "#{dir}/#{u}/github"   , user: u, token: true
  gist       "#{dir}/#{u}/gist"     , user: u, auth: :github
end

Methods

bitbucket repo #, options...
github    repo #, options...
gist      repo #, options...

Options

user:   "username"    # mandatory
token:  true          # use token instead of user/pass (default: false)
auth:   false         # use authentication (default: true);
                      # use :github w/ gist to re-use github auth
method: :https        # clone method (default: :ssh);
                      # NB: https auth not implemented yet

TODO

Some things that may be useful/implemented at some point.

  • gitlab w/ groups & server
  • github organisations
  • bitbucket teams

  • ask password again on typo (^D) or auth fail
  • tests?
  • better error handling?
  • use obfusk-util (for prompt etc.)?

  • custom services (should be easy to add already)
  • metadata (issues, wikis, ...)
  • teams/organisations
  • starred repos/gists
  • filtering
  • oauth?

  • specify ssh key(s)?
  • https clone auth?

License

GPLv3+ [1].

References

[1] GNU General Public License, version 3 --- http://www.gnu.org/licenses/gpl-3.0.html

[]: ! ( vim: set tw=70 sw=2 sts=2 et fdm=marker : )

About

UNMAINTAINED & REPLACED BY https://github.com/obfusk/ghbak !!! [gitbak - bitbucket/github/gist backup]

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages