From a79414bcf14d17c58e040a7b8524f7bd8f7e5e03 Mon Sep 17 00:00:00 2001 From: Nat Lasseter Date: Mon, 22 Jan 2024 10:23:58 +0000 Subject: Migrate from gists --- gitmove | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100755 gitmove (limited to 'gitmove') diff --git a/gitmove b/gitmove new file mode 100755 index 0000000..90a943d --- /dev/null +++ b/gitmove @@ -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." -- cgit v1.2.3