Repository setup
Week 0 - Discussion section
This discussion section will guide you through setting up a repository where you will collect your notebooks for the course’s discussion sections. In this discussion section, you will:
- Practice creating a new repository and updating it’s README
- Practice version control using git via the terminal
Setup
1. Create repository
Create a new repository on GitHub. Use the following settings:
Repository name:
eds220-2024-sections
.Description: Work during discussion sections for the EDS 220 MEDS course.
Keep the repository public.
Add a README file.
Add a Python .gitignore template.
In GitHub, update your repository’s README by:
- Deleting the text that was automatically generated when you created the repo.
- Copy-pasting the markdown text below, do not update
[YOUR NAME HERE]
yet.
# EDS 220 Discussion Sections Repository
This repository hosts all the work completed by [YOUR NAME HERE] during the discussion sections of EDS 220 - *Working with Environmental Datasets*.
## Course Information
- **Course Title:** EDS 220 - Working with Environmental Datasets
- **Term:** Fall 2024
- **Program:** [UCSB Masters in Environmental Data Science](https://bren.ucsb.edu/masters-programs/master-environmental-data-science)
- **Instructor:** Carmen Galaz García
- **TA:** Annie Adams
Complete materials for the discussion sections and additional resources can be found on the [course website](https://meds-eds-220.github.io/MEDS-eds-220-course/discussion-sections/discussion-sections-listing.html).
- Add the URL to your GitHub repository to this spreadhseet.
MAKE SURE YOU’VE SUCCESSFULLY SET UP YOUR REPOSITORY ON GITHUB BEFORE CONTINUING
2. Clone the repository
At Bren’s workbench 1 server, start a new JupyterLab session or access an active one.
Inside your
MEDS/
directory, create a new directory calledEDS-220
. We’ll use this directory to collect all the repositories used in the course.In the terminal, navigate to the
EDS-220
directory by usingcd NAME-OF-DIRECTORY
.Using the terminal, clone the repository into your
EDS-220
directory. To do this:In your repository’s landing page on GitHub, click on the green button that says
< > Code
. In the HTTPS tab option, copy the URL that appears there.Go back to the server. In the terminal, run
pwd
(print working directory) to make sure we’ll be cloning into the desired location (inside the EDS-220 directory). The ouput should look like:
/Users/c_galazgarcia/MEDS/EDS-220/
Run
git clone URL
. You should see the directory appear in the folder navigation bar to the leftGo into the cloned repo in the terminal:
cd eds220-2024-sections
.
3. Update your name and push changes
Open the
README.md
file and update the[YOUR NAME HERE]
with your name. Save your changes.Push your changes to your remote repository (remember, in this case, this is how we call the copy of your repo that lives in GitHub). To do this, remember the basic git routine:
git status
: check git status, shows which files are staged, modified, or untrackedgit add FILE-NAME
: stage files that have been updated, these files will be added to your next commitgit status
: check git status again to confirm you have staged the right filesgit commit -m "Commit message"
: create a commit with messagegit pull
: pull latest changes before pushing to ensure your local repo is up-to-dategit push
: push your changes to upstream repo
You should have previously configured your personal access token (PAT) during summer session, but it might be possible that it is not cached anymore and you are prompted to create a new one when doing
git push
. If this is the case:- Follow the instructions in the MEDS setup guide to create a new PAT.
- Once you have created your PAT, do
git push
again to push your changes.
MAKE SURE YOU’VE SUCCESSFULLY PUSHED YOUR UPDATES BEFORE ENDING