Imported Old Repos

October 17, 2021

Several months ago I used fast-export to convert most of my old repositories from Mercurial to Git. This morning I finally imported the converted repositories to GitHub and archived them.

The old repositories are as follows:

Here is the repo import script:

#!/bin/bash

set -eu 

# space-delimited list of repos
repos='... omitted for brevity ...'

# get base repo dir
base=$(pwd)

# loop through repos
for repo in $repos; do
  # print repo name, switch to repo
  echo repo: $repo
  cd "$base/$repo"

  # create repo
  gh repo create $repo

  # fix origin
  # (gh sets the origin to "https://github.com/pablotron/...)
  git remote rm origin
  git remote add origin git@github.com:pablotron/$repo.git

  # push upstream
  git push -u origin master

  # archive repo
  gh repo archive $repo
done