GitHub to CS

Already have a GitHub Pages site that you'd like to host at Brown CS?  Can do.

1. Upload an SSH Key

Follow our instructions to create and upload an SSH Key which you will use to access your Git Pages repository.  Select the gitpages service.  You can also reuse an existing key by assigning it to the gitpages service (though we recommend using separate keys for better security).  Always use a long or obscure passphrase when creating ssh keys.

2. Create a Repository

Visit the Git Pages site to create an empty repository.  You will need to log into the website using your Brown credentials.  It may take a few moments for it to appear, so refresh your browser.  You will also receive an email when it is ready.

3. Clone Your Repository

Create a working copy of your site by cloning it.

git clone gitpages.cs.brown.edu:people/yourname

If your username on your device does not match your Brown username you'll have to be explicit about it.

git clone yourname@gitpages.cs.brown.edu:people/yourname

Your new repository will be empty.  That's fine, let's get your site from GitHub.

4. Pull Your Site From GitHub

Add a remote in your new repository that points to your existing GitHub site and pull it.

git remote add github ssh://git@github.com/my/site
git pull github main

Almost there.

5. Build Your Site at Brown CS

git push origin main

Just like GitHub, pushing your changes triggers a site build.  In a few moments it will become available.

Problems?

Okay, this is a new service, and GitHub Pages is surprisingly complicated.  There are some limits and some things to be aware of.

Jekyll or Static

GitPages in CS only supports building Jekyll sites.  If you are using something else, you'll have to build the site first and push the static html files.

Relative Links Only

All the links in your site must be relative.  GitHub sites are all rooted at the top-level.  GitPages sites in CS are rooted lower down, for instance, under /people/.  So if you link relative to the top, you'll jump out of your site.  Relative links will work fine on your GitHub Pages site, so it's not a problem to keep the content in sync.

Other Issues?

Please let us know.