GitHub Workflow - norrissam/ra-manual GitHub Wiki

Our workflow is organized around GitHub branches. Each discrete task should be done in its own GitHub branch. Usually these are made directly from main. The branch should be called something informative, like calculate-recidivism.

In each branch, you can make as many intermediate commits as you like. In fact, it is good practise to do so to keep track of what you've done. Feel free to include informative notes and commit messages in the intermediate commits.

When the task is done, the branch should be merged back into main via a pull request.

Keeping branches up to date and managing conflicts

When you create a pull request, it will tell you if there are any conflicts. These are sometimes trivial (updated exhibits pdfs always create conflicts), but sometimes there are conflicts in the code that take more care to resolve.

If there are conflicts, you can fix them by merging main into the branch and resolving conflicts. This can be done on the command line:

git fetch origin         # gets latest changes made to master
git checkout feature     # switch to your feature branch
git merge main         # merge with master
# resolve any merge conflicts here
git push origin feature  # push branch and update the pull request

(NB: all of these steps can be done in GitHub Desktop except for git merge main.)

Comparing commits

Sometimes it will be necessary to compare versions of code to understand why results have changed. You can do this by tracking down the commits (ie from the commit history in the code tab), and then editing the below url:

https://github.com///compare/<hash 1>..<hash 2>

you fill in the < > fields, where the owner name is probably norrissam, the repo name should be self evident, and the hash's are the 7 character alphanumeric commit identifiers (e.g. a25d90e). You can access these in the commit history or the pull request (the url will look something like https://github.com/norrissam/ref-judge/tree/c4b564a092e27a7c063729bd36adc2e2659926bb, but just take the first seven characters of the hash, ie c4b564a).

⚠️ **GitHub.com Fallback** ⚠️