1.2. Working and Collaborating with an Existing Codebase#
In this exercise, you will learn how to work within an existing codebase using Git and GitHub, while gaining practical experience with Jupyter Notebooks and Python programming.
Start by visiting the repository: UF-5771/Novel-Lab1-Collaboration.
1.2.1. Setup#
We’ll learn the standard GitHub workflow for contributing to shared projects.
1.2.1.1. Fork this Repository#
A fork is your personal copy of this repository. It lets you make changes without affecting the original project.
Click Fork at the top-right of this page.
GitHub will create a copy under your account (e.g.,
your-username/Novel-Lab1-Collaboration).
1.2.1.2. Clone Your Fork (using VS Code’s Git integration)#
You’ll use VS Code’s built-in Git tools to clone your fork and open it locally.
In GitHub, copy your fork’s clone URL (e.g.,
https://github.com/your-username/Novel-Lab1-Collaboration.git).In VS Code, open the Command Palette:
Windows/Linux:
Ctrl+Shift+PmacOS:
Cmd+Shift+P
Run
Git: Cloneand paste the URL.Choose a local folder and click Open once cloning is done.
If prompted, sign in to GitHub to enable pushing and pull requests.
Confirm the repository is loaded by opening the Source Control view to see tracked changes and branches.
1.2.1.3. Create a New Branch#
Branches isolate changes so you can work safely without affecting the main project. You can use the branch picker or run Git: Create Branch to make a branch (e.g., feature/your-name-introduction) or run the command below:
git checkout -b feature/your-name-introduction
(Example: git checkout -b feature/alice-johnson-introduction)
This integrates cloning, branching, committing, and pushing directly in VS Code.
1.2.2. Task#
Complete the Jupyter notebook student_introduction.ipynb by adding the missing information. Feel free to not add personal details.
Open the notebook in VS Code.
Edit all sections labeled YOUR TURN.
Run all cells to ensure everything executes correctly:
Shift + Enterfor one cell“Run All” to execute the entire notebook
Save your work (
Ctrl+SorCmd+S).
1.2.3. Stage and Commit Your Changes#
Prepare and save your updates locally.
git status
git add student_introduction.ipynb
git commit -m "Complete student introduction with personal information"
Use clear, descriptive commit messages (e.g., “Add personal info to notebook”).
1.2.4. Push Your Branch to GitHub#
Upload your branch to your fork:
git push origin feature/your-name-introduction
1.2.5. Create a Pull Request (PR)#
Request to merge your branch into the main repository.
Go to your fork on GitHub.
Click Compare & pull request.
Set:
Base repository:
UF-5771/Novel-Lab1-CollaborationBase branch:
mainHead repository:
your-username/Novel-Lab1-CollaborationCompare branch:
feature/your-name-introduction
Add a clear title and short description.
Example:
## Changes Made
- Added personal details in Section 2
- Completed birth date calculation in Section 4
All cells executed successfully.
Click Create Pull Request.
This marks the end of Week 1 lab exercise!