Skip to article frontmatterSkip to article content

GitHub Setup

GitHub

“GitHub is a cloud-based platform where you can store, share, and work together with others to write code.” (See About GitHub)

The following are very brief instructions to get started. (For more information, see https://docs.github.com/en/get-started/start-your-journey/hello-world).

  1. Sign in/up at GitHub. If you already have an account (or have a google account), go to “Sign in”. If not, then go to “Sign up”.

  2. On Home/Dashboard, click “New” to create a repository (repo).

    jupyter-notebook-usage
    • Name it after the class you’re in, e.g., “ECON304”.

    • Under “Choose visibility” select “Private” (until you’re ready for the world to see your work).

  3. Optional: If you eventually/plan to do a lot of collaborative programming with different integrated development environments (IDEs such as Stata, RStudio, MATLAB, VS Code), then I recommend installing GitHub Desktop.

You may create and edit Jupyter Notebooks remotely (recommended) or locally (optional). The following are instructions on how to setup git for either choice.

Remote Setup

I recommend this setup first as it does not require installing any software, and you can program and work collaboratively in any browser from any computer.

  1. Log in to https://jupyterhub.wm.edu with your W&M credentials

  2. If prompetd, select “Default Notebook (A Python3 SciPy Notebook)”

  3. Go to https://www.github.com/settings/tokens and create a personal access token.

    • Put “jupyterhub.wm.edu” for the note.

    • Under “Select scopes”, check the “repo” box.

    jupyter-notebook-usage
  4. Find the URL to your repo, e.g.,

jupyter-notebook-usage
  1. JupyterHub, Git tab, “Clone a Repository”, enter URL to repo, username and token.

jupyter-notebook-usage
  1. In the Launcher tab, click the “Python 3 (ipykernal)” button to create a Jupyter Notebook.

jupyter-notebook-usage

Git

Local Setup

While the Remote Setup makes it easy to get started, the interface is simple and there is no AI assistant. VS Code is a sophisticated IDE that supports lots of languages, including Python, has an extension to support Jupyter Notebooks, and has GitHub Copilot built-in.

  1. Download and install VS Code for your operating system https://code.visualstudio.com/Download

  2. Open VS Code, go to “Extensions” tab

    • Search for “Jupyter” and install the extension.

    jupyter-notebook-usage
    • Search for “Python” and install the extension.

    jupyter-notebook-usage
  3. Optional: If not using GitHub Desktop, go to the “Source Control” tab

    • Click “Clone Repository”, then click “Clone from GitHub”.

    jupyter-notebook-usage
    • Log into GitHub in the browser

    • Go back to VS Code, click "Clone Repository " and select the repository from the drop down menu.

    jupyter-notebook-usage
  4. Optional: If Copilot is not already set up, click “Finish Setup” in the lower-right corner, then click “Set up Copilot”.

jupyter-notebook-usage