diff options
author | Nat Lasseter <nat.lasseter@york.ac.uk> | 2024-01-22 10:23:58 +0000 |
---|---|---|
committer | Nat Lasseter <nat.lasseter@york.ac.uk> | 2024-01-22 10:23:58 +0000 |
commit | a79414bcf14d17c58e040a7b8524f7bd8f7e5e03 (patch) | |
tree | 4f2f232aca568711ecb35caa3444b54f4dfa4361 /gitmove |
Migrate from gists
Diffstat (limited to 'gitmove')
-rwxr-xr-x | gitmove | 31 |
1 files changed, 31 insertions, 0 deletions
@@ -0,0 +1,31 @@ +#!/usr/bin/env ruby +#!DESCRIBE: Migrate repos to gitolite + +iam = "me" +from = "git@github.com:Me/" +to = "git@gitolite:" +repos = %w( ... ) + +File.open("repos.conf", ?w) do |f| + repos.each do |r| + f.puts "repo #{r}" + f.puts " RW+ = #{iam}" + end +end + +File.open("repos.script", ?w) do |f| + f.puts "#!/bin/bash" + repos.each do |r| + f.puts "git clone --bare #{from}#{r} __repo_#{r}" + f.puts "cd __repo_#{r}" + f.puts "git push --all #{to}#{r}" + f.puts "git push --tags #{to}#{r}" + f.puts "cd .." + f.puts "rm -rf __repo_#{r}" + f.puts + end +end + +File.chmod(0744, "repos.script") + +puts "Done generating; now push the contents of repos.conf to your gitolite config, then run the repos.script script." |