1 of 34

GitHub Clinic

Contributing from the browser

Champions Program

CC By Openscapes

Artwork by Allison Horst

Last updated 2022-10-21; deprecated. Current version

1

2 of 34

Today’s Goals

  • Growth Mindset & motivation for GitHub
    • Powerful way to contribute & collaborate across responsibilities
  • Explore GitHub as a tool beyond code and archiving (together)
    • GitHub commits to contribute and publish
    • GitHub Issues for project management
  • Practice GitHub from the browser (breakout rooms)
  • Today’s Clinic: designed for everyone across levels to learn and help each other

2

3 of 34

We won’t cover local git/GitHub setup/workflows today.

Excellent resources to learn more:

  • Excuse me, do you have a moment to talk about version control? (Bryan)
    • Humorous, honest discussion paper re: GitHub value (American Statistician & PeerJ)
  • Git for Humans (Bartlett)
    • Nice intro of GitHub for non-coders (video)
  • Happy Git with R (Bryan)
    • Friendly resource for git/GitHub theory, commands, workflows, troubleshooting. R/Studio focused but relevant far beyond.
  • R for Excel Users workshop (Lowndes & Horst)
    • Collaborative R/RStudio + GitHub workflows with environmental data (LTER)

3

4 of 34

Growth Mindset

  • The power of yet:

you develop abilities through practice

  • Compared to a

fixed mindset, where abilities are static

  • Important mindset for working with Future You and Future Us
  • We can bring this thinking to GitHub

Research by Carol Dweck (book, TED Talk; video)

Illustrations from “GitHub for supporting, contributing, and failing safely”

(Horst & Lowndes 2022)"

5 of 34

“Collaboration is the most compelling reason to manage a project with Git and GitHub”

(Bryan 2017, PeerJ, “Excuse Me, Do You Have a Moment to Talk About Version Control”)

  • Future You, Future Us
  • Across computers/devices
  • Active makers, readers, reviewers

–> To introduce GitHub, we can use the idea of climbing

5

6 of 34

6

7 of 34

7

GitHub “commits” help us focus on the work, not the bookkeeping

It takes care of otherwise time-consuming versioning and unrelenting file tracking.

8 of 34

8

GitHub “Issues” helps us support others and existing work

It helps us with organizing, improving documentation, asking and answering questions - critical to all projects whether we’re writing code or not.

9 of 34

What is GitHub? – traditional answer

  • GitHub is a company - an online collaborative platform. It is built on top of Git - software that does file versioning and bookkeeping.
  • You can think of GitHub working like Dropbox - but with more control.

9

10 of 34

What is GitHub? – nontraditional answer

  • Publishing platform. A new way for sharing & communication - your files can become websites! Share the url once, it’s always the latest version.

  • Project management system. Short- and long-term collaborative “todo” lists
    • “Issues” & “Projects”

10

Annual reports

Shared todo’s

11 of 34

GitHub framework in a nutshell

  • Repositories (“repos”) - main unit, a folder
    • Contained, with permissions
    • Public or private
  • Users vs. Organizations
    • EmilyMarkowitz-NOAA vs.

nmfs-openscapes

  • Commits & Issues
    • The way you contribute

through GitHub

Let’s explore a repo and commit a change →

11

Above, NMFS-Openscapes is the organization with the 2022-noaa-afsc-fall repository. This repo has 2 files. The most recent commit was made by EmilyMarkowitz-NOAA (a user) 11 days ago: they updated the README.md file.

repo

org

org

repo

12 of 34

GitHub repo

orientation

(demo)

Let’s explore a repo: ggplot2.

Every GitHub repo looks the same.

First things to look for in red:

12

URL (changes as you navigate)

[user or org] / repo (doesn’t change)

Files and folders

Recent activity?

website

Scroll down for README

13 of 34

Let’s edit files from GitHub (demo)

In our Cohort repo

Note: editing from the browser is limiting – your main workflow will be to sync the repo to your local computer. However, you will sometimes edit in the browser, and it’s a no-install-required way to onboard new people to GitHub

13

Click pencil to edit

Write! Supports Markdown formatting

Scroll down to commit!

Markdown is a formatting language with only about 15 rules. Notice syntax for # headers and *italics*

(see cheatsheet)

14 of 34

Your turn: practice editing & committing

Goals: practice committing work in GitHub

  1. Go to our repo and find yourname.md
  2. Click on the pencil to edit your file
  3. Practice small edits & commits with commit messages
    1. Github.com has a default message, but get into the habit of writing an actual message to yourself/others (breadcrumbs)
    2. If it asks you to propose changes rather than committing, check your email to accept the invite to collaborate in this repo
  4. Also try: upload a file via drag-and-drop (it will be public!)
  5. Have fun! Talk to your breakout group, share what you learn

14

15 of 34

Review together after breakout rooms (demo)

  • You’ve been collaborating on GitHub! Look at the commits:

15

16 of 34

Good project management

  • Using project management software -

a strategy used by software developers

and people working on projects with many moving parts

  • Organize and track projects with single or multiple & overlapping users
  • Streamline technical discussions for people with different responsibilities
  • Key for onboarding Future You and Future Us
  • GitHub Issues let you discuss/organize in the same place as your code

16

17 of 34

GitHub Issues in the wild

17

Open software peer review

Bug reports, code, feature, & help requests

Event crowdsourcing and planning

“traditional” and “less traditional”

🎉

18 of 34

Explore GitHub Issues (demo)

Let’s go to our Cohort’s repository > Issues

18

19 of 34

Your turn: practice creating & commenting on issues

Goals: practice using Issues for collaboration, Markdown practice

  • Go to our cohort repo’s Issues
  • Create an Issue, tag people in your breakout group (ask their usernames)
  • Browse issues, comment in other issues. Try:
    • Practicing Markdown
    • Creating a label and applying it, assigning people
    • Adding issues to a Project (create one if need be)
    • Closing an Issue
  • Have fun! Talk to your breakout group, share what you learn

19

20 of 34

Regroup

Here’s what your inbox will look like afterwards:

20

This is pretty rare to receive so many Issues emails all at once.

But you can switch your setting so that you only receive emails about Issues that you are tagged in. Click on Watch in the top right:

21 of 34

GitHub Organizations & Projects examples:

21

Project Boards for Issues (kanban board)

Project has a mix of public & private Issues

Organizations for skillsharing and teaching

22 of 34

GitHub has a built-in viewer

22

23 of 34

View your repo as a website!

username.github.io/reponame/

nmfs-openscapes/2022-noaa-nwfsc-fall/github-clinic/yourfile

  • 404 error? Remove trailing / from the url
  • Wants you to download? Remove trailing .md from the url
  • This worked because of repo’s settings: GitHub Pages
    • Settings > Pages > Source > Branch: main, /(root)

23

24 of 34

Extra slides

24

25 of 34

GitHub Issues in the wild

25

Private conversations and archiving

Bug reports, code, feature, & help requests

Event submissions and coordination

“traditional” and “less traditional”

26 of 34

Explore GitHub Issues (demo)

Let’s go to our Cohort’s repository > Issues

26

27 of 34

Strategies for Issues

  • Every repo has issues, but do you want to use issues in every repo? Consider the purpose:
    • “Traditional” bug/features for code: keep it public within that repo
    • “Non-traditional” lab & science conversations: make private, think ahead: will the code/contents of that repo be made public in the future?
  • OHI thought process & strategy:
    • Although we have many repos, we didn’t want to have to search across repos to find a conversation (although now GH can search across Organizations!)
    • We also wanted our repos to be public, but to have private conversations
    • So we created a single private repo called “issues” that we only use for issues.

27

28 of 34

28

So far, we’ve been working on GitHub.com, where we contribute changes through commits

When we work elsewhere, to contribute we stage, commit then push back to GitHub.com

Stage and Commit your changes after saving

*

*(or JupyterHub)

To get our work elsewhere we clone the first time and thereafter pull any updates from GitHub.com

Pull, commit, push together is called syncing

29 of 34

GitHub syncing

29

To contribute back to GitHub.com from your local or cloud setup:

30 of 34

30

31 of 34

GitHub is collaborative software designed to organize interrelated files and to track changes by potentially different people through time - not limited to code.

31

Illustrations from “GitHub for supporting, contributing, and failing safely”

(Horst & Lowndes 2022)"

32 of 34

32

GitHub helps us reuse

GitHub helps us reuse existing work, which lets us learn and build from other people’s shared experience rather than reinventing on our own.

GitHub helps us fail safely

Because we can return to previous versions easily, painful consequences of failing are reduced. We can more bravely try things and start making contributions.

33 of 34

GitHub repo

orientation

(demo)

Let’s go to our cohort repo.

Every GitHub repo looks the same.

Here’s the first things to look for:

33

URL (changes as you navigate)

[user or org] / repo (doesn’t change)

Files and folders

Recent activity?

website

Scroll down for README

34 of 34

GitHub repos & issues examples

34

Shared, running list of resources we find useful