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:


set -eu 

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

# get base repo dir

# 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 "
  git remote rm origin
  git remote add origin$repo.git

  # push upstream
  git push -u origin master

  # archive repo
  gh repo archive $repo