Skip to content

answer/github-tools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

github や bitbucket のリポジトリをローカル gitolite に push する

  • bash 4.1-2ubuntu3

$ crontab -e

# backup github repos
27 6 * * * /path/to/backup-repos.sh >> /dev/null 2>&1

ログをどこかに保存する場合は logrotate も適切に設定すること

  • git リポジトリ: ~/$backup_dir/<リポジトリ名>

  • $backup_prefix/<リポジトリ名>

  • ~/.github-tools.rc

    • gitolite_ssh=“gitolite に接続するための ssh エイリアス名(必須)”

    • backup_dir=“github から clone するディレクトリ (default: ~/.backup-repos)”

    • backup_repos=( …)

backup_repos は下記 backup-repos.sh 参照

設定したリポジトリを clone して gitolite に push する

backup_repos=(
  "github git://github.com/ answer/gitolite-tools"
  "github git://github.com/ answer/github-tools"
  "bitbucket git@bitbucket.org: answer/my-bitbucket-project"
)

リストは二重引用符 “ で囲った文字列の配列を指定する

指定する文字列は、

  1. gitolite リポジトリの prefix

  2. ホスト名

  3. リポジトリパス

を、空白で区切って指定する

ホスト名と、リポジトリパスは、そのまま連結して git clone 出来る形式で指定する

cron で bitbucket リポジトリをバックアップする場合、実行ユーザーのパスフレーズなしの鍵を登録しておく必要がある

About

github 関連の bash スクリプト

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages