Code
/to/your/EDS-217 cd path
Creating a GitHub Repository for Your EDS 217 Course Work
This session contains detailed instructions for creating a new GitHub repository and pushing your EDS 217 course work to it. It also covers how to clean your Jupyter notebooks before committing them to ensure your repository is clean and professional.
Jupyter notebooks files can be hard to use in github because they contain information about code execution order and output in the file. For this reason, you should clean notebooks before pushing them to a github repo. We will clean them using the nbstripout
python package
Letโs start by creating a new repository on GitHub:
After creating the repository, youโll see a page with instructions. Weโll use these in the next steps.
Now, letโs set up your local directory as a Git repository:
workbench
serverReplace your-username
with your actual GitHub username.
Before we commit our notebooks, letโs clean them to remove output cells and execution data:
nbstripout
tool if you havenโt already:By default, the server wonโt add a new python package to the main package repository on workbench
. For this reason, you will see a warning when running the pip command that looks something like this:
WARNING: The script nbstripout is installed in '/Users/[your user id]/.local/bin' which is not on PATH
Therefore, we need to access the nbsripout
command by specifying itโs location in your local user folder:
nbstripout
for your repository:This sets up nbstripout
to automatically clean your notebooks when you commit them.
Now weโre ready to add our files to the repository:
Note: If your default branch is named โmasterโ instead of โmainโ, use git push -u origin master
.
Congratulations! Youโve successfully created a GitHub repository for your EDS 217 course work, cleaned your Jupyter notebooks, and pushed your files to GitHub. This process helps you maintain a clean, professional repository of your work that you can easily share or refer back to in the future.