-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tutorial 2 2022-2023 w2 #30
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Tutorial 2 - Git + GitHub Practice
Using the version control chapter from our course notes:
https://ubc-dsci.github.io/reproducible-and-trustworthy-workflows-for-data-science/materials/lectures/02-version-control-1.html
Important note:
Exercise 1: Simple File Merge Conflict
Steps:
Click the green “Use this template” > "Create a new repository" button from this GitHub repository to obtain a copy of it for yourself (do not fork it).
YYYY-MM-DD-merge_conflict_1
Clone this repository to your computer (make sure you do this step in order)
git clone <URL>
(e.g., in your~/git
folder)Allow the GitHub action to create the merge conflict
Create a remote branch named
make-conflict
(this will use GitHub Actions to create a commit in your remote repository).main
drop downmake-conflict
as the branch nameOn your local computer (where you
clone
d, fix the second line incube.r
so that it calculates the cube, not the square (e.g., change x^2 to x^3).main
branch on your local machinecommit
your changes to version control via Git andpush
your changes to GitHub.git config pull.rebase false
setting for default merge behaviourmain
branch, and be pushing tomain
on the remoteResolve the merge conflict so that you can see your changes on GitHub.
pull
the remote contentsgit status
to help you through committing the conflict after you fix the fileExercise 2: Complex File Merge Conflict
https://ubc-dsci.github.io/reproducible-and-trustworthy-workflows-for-data-science/materials/lectures/02-version-control-1.html#resolving-merge-conflicts-in-a-more-complex-text-file
Use
YYYY-MM-DD-merge_conflict_2
as the repo nameSame process as above where you will create repo as template, clone, allow gh action permissions,
make-conflict
branch, edit file locally, and push / fix conflictsThe VSCode python extension should be able to open/read
.ipynb
files, you don't really need to try and execute the code blocks for this to work.During merge conflict resolution, because it's not a valid JSON file/notebook anymore, you will have to fix things in regular plain text mode
If you click on
cube.ipynb
after conflict + push, it should render in githubExercise 3: Do a code review with a pull request
https://ubc-dsci.github.io/reproducible-and-trustworthy-workflows-for-data-science/materials/lectures/02-version-control-1.html#demo-do-a-code-review
special note about this exercise:
master
notmain
use
YYYY-MM-DD-pr_1
as the repo nameyou don't need to clone the repo to your computer, you can fix and modify the code directly in github
make sure you change the action > general > Workflow permissions as exercise 1
create a new branch in the interface called
pr
it will create an action and generate a PR for reviewGo to the Pull Request tab
Click on the PR created
Follow steps in exercise, try to make a comment
Usually the person who submitted the PR is responsible for fixing their code
Merge the pull request when done (it's just an exercise to go through all the mechanics)
The text was updated successfully, but these errors were encountered: