Non-Research Tips for Information
Science Researchers (Summer 2024)
May 1, 2024
Week 9: GitHub in depth
https://non-research-tips.github.io/2024

Yusuke Matsui(UTokyo)1

Schedule
Date (2024)

Contents

Presented by

Week 1, Apr 10

Introduction. Review of fundamental concepts

Yusuke, Koya, Yuki, Jun

Week 2, Apr 17

Equations and pseudo-codes

Yusuke Matsui

Week 3, Apr 24

Presentation

Koya Narumi

Week 4, May 1

Tables and plots

Yusuke Matsui

Week 5, May 8

Figures

Koya Narumi

Week 6, May 22

VideosKoya Narumi

Week 7, May 29

Invited Talk 1

Dr. Yoshiaki Bando (AIST)

Week 8, June 5

Invited Talk 2

Prof. Katie Seaborn (Tokyo Tech)

Week 9, June 12

GitHub in depth

Yusuke Matsui

Week 10, June 19

Automation of research and research
dissemination (Web, Cloud, CI/CD)

Jun Kato

Week 11, June 26

Research community

Jun Kato

Week 12, July 3

3DCG illustrations

Yuki Koyama

Week 13, July 10

Final presentations-2

Q1: Do you have a
In today’s talk, all logs of GitHub are from https://github.com/logos

account?
3

Q2: Do you think you are good at using
In today’s talk, all logs of GitHub are from https://github.com/logos's features?
4Q2: Do you think you are good at using's features?

Hmm… GitHub is a service for hosting a repository?
I back up my source code using GitHub…

5

Q2: Do you think you are good at using's features?

Hmm… GitHub is a service for hosting a repository?
I back up my source code using GitHub…

GitHub is not just a repository hosting service.
Understanding GitHub deeply will enhance yourresearch productivity.
6 History and basics
 Issue Advanced markdown
 Actions Pages Codespaces
 Project
 CLI
 Copilot
7 History and basics
 Issue Advanced markdown
 Actions Pages Codespaces
 Project
 CLI
 Copilot
8

GitHub is…
 (1) a Git repository hosting service (like Bitbucket and GitLab).
 (2) SNS.
 Public profile, follow, stars, contribution calendar, etc.
 PRs for public repository = social activities.
 Mentioning (e.g., @matsui528) and referring (e.g., #13) are
central concepts of GitHub.
 (3) a platform for team coding.
 This is the main feature of GitHub, but I don’t talk.
 (4) a platform that continuously rolls out experimental services
to improve the software engineering experience (today’s topics)

9

GitHub is…
 (1) a Git repository hosting service (like Bitbucket and GitLab).
 (2) SNS.
 Public profile, follow, stars, contribution calendar, etc.
 PRs for public repository = social activities.
 Mentioning (e.g., @matsui528) and referring (e.g., #13) are
central concepts of GitHub.
 (3) a platform for team coding.
 This is the main feature of GitHub, but I don’t talk.
 (4) a platform that continuously rolls out experimental services
to improve the software engineering experience (today’s topics)

10

GitHub is…
 (1) a Git repository hosting service (like Bitbucket and GitLab).
 (2) SNS.
 Public profile, follow, stars, contribution calendar, etc.
 PRs for public repository = social activities.
 Mentioning (e.g., @matsui528) and referring (e.g., #13) are
central concepts of GitHub.
 (3) a platform for team coding.
 This is the main feature of GitHub, but I don’t talk.
 (4) a platform that continuously rolls out experimental services
to improve the software engineering experience (today’s topics)

11

GitHub is…
 (1) a Git repository hosting service (like Bitbucket and GitLab).
 (2) SNS.
 Public profile, follow, stars, contribution calendar, etc.
 PRs for public repository = social activities.
 Mentioning (e.g., @matsui528) and referring (e.g., #13) are
central concepts of GitHub.
 (3) a platform for team coding.
 This is the main feature of GitHub, but I don’t talk.
 (4) a platform that continuously rolls out experimental services
to improve the software engineering experience (today’s topics)

12

Open-source software (OSS) GitHub is originally (has been?) the place for open-source projects.
 Before GitHub, distributing source code had a more "one-way" nature.
 It was not easy for new users to discuss with developers.

History, classification,
problems, magnetization,of OSS

Very simple guideline for OSS by GitHub
https://opensource.guide/

Nadia Eghbal, “Working in Public: The Making and
Maintenance of Open Source Software”, Stripe Press, 2020.

13

Open-source license “Open-source licenses are software licenses that allow content to be used,
modified, and shared.” From [1] OSS license itself is a big topic and I don’t cover in this lecture.
 You need to know: When you use open-source codes, you must understand its license.
 When you decide to make your codes open-source,
you need to decide a proper OSS license.
 In AI-related area, remember the following terms:
 Source codes: OSS licenses such as MIT, GPL, …
 Images etc: Creative-commons (CC) license(CC is not OSS, but you need to know it, too)

14[1] https://en.wikipedia.org/wiki/Open-source_license

Open-source license “Open-source licenses are software licenses that allow content to be used,
modified, and shared.” From [1] OSS license itself is a big topic and I don’t cover in this lecture.
 You need to know: When you use open-source codes, you must understand its license.
 When you decide to make your codes open-source,
you need to decide a proper OSS license.
 In AI-related area, remember the following terms:
 Source codes: OSS licenses such as MIT, GPL, …
 Images etc: Creative-commons (CC) license(CC is not OSS, but you need to know it, too)15

[1] https://en.wikipedia.org/wiki/Open-source_license

Open-source license “Open-source licenses are software licenses that allow content to be used,
modified, and shared.” From [1] OSS license itself is a big topic and I don’t cover in this lecture.
 You need to know: When you use open-source codes, you must understand its license.
 When you decide to make your codes open-source,
you need to decide a proper OSS license.
 In AI-related area, remember the following terms:
GitHubgenerates Source codes: OSS licenses such as MIT,
GPL,automatically…
the license for your project.
 Images etc: Creative-commons (CC) license(CC is not OSS, but you need to know it, too)16

[1] https://en.wikipedia.org/wiki/Open-source_license

Acquisition by Microsoft
 MS acquired GitHub in 2018. At that time, MS was considered the
opposite of OSS (MS is now biggest supporter of OSS, though).
 Many thought that GitHub would end after being acquired by MS,
but so far it has been doing well.
 e.g., almost free actions for everyone… by Azure!

17

Current GitHub
 So far, GitHub is releasing interesting services ever day.
 If you want to become a good SWE, it might be a good idea to startby learning about the various services GitHub offers.
 You can gain insight into the foundation of the most modern
software stacks.
 GitHub features are also very usefulfor advancing your research activities.

https://github.blog/18

Be careful About data: Although GitHub is very useful, please use it according to
the terms and lab rules!
 For example, if you’re handling secret medical data by your boss’s
collaborators, you may not be allowed to send any data to GitHub.
 Ask your professors if you have any concerns.
 About human factors:
 GitHub is SNS… meaning that you may be attacked.
 Like any other SNS, always behave in a manner that respects others.

19Student benefit (GitHub education)
 With your university email, you can obtain GitHub featuresequivalent to paid plans, e.g., pages and wikis for secret repos.
 With this, all features I talk today are almost free.
 No side effects. You should apply now.
 If you go PhD and keep in academia, you can keep using thebenefits!

https://github.com/edu/students

20 History and basics
 Issue Advanced markdown
 Actions Pages Codespaces
 Project
 CLI
 Copilot
21

Issue Very simple (but visually beautiful) bulletin board.
 No threads
 Each issue has a unique ID (i.e., anyone can refer it later)
 Each post in each issue has a unique ID (i.e., anyone can refer it later) Per repository (everything is repository-centric).
 Place for communication.
 Can be used for any purposes.
 Questions, bug reports, feature requests, discussion, etc.
 The simplest, but the most powerful feature by GitHub.
 Advanced usage: trigger/outputs for CI/CD.

22

IssueUnique ID

It’s clear who
said what

Simple, one-directionalbulletin board

23

Issue When you post issues, please be very polite!
 There are a lot of rude issues, like “implement this feature ASAP” or“this is a bug, fix it” without even reading the reference.
 Such issues make developers angry.
 Issue is a record of discussion, and you can refer it years later.
 Internal records (e.g., .docx files in your computer) must disappear.
But issues will always remain.
 It may be a good idea to keep the record of experiments by issues.

It’s easy to share the results with others.

24 History and basics
 Issue Advanced markdown
 Actions Pages Codespaces
 Project
 CLI
 Copilot
25

Advanced Markdown You can write alerts.
> [!NOTE]> Now GitHub supports the alert message likethis.
https://github.blog/changelog/2023-12-14-new-markdown-extension-alerts-provide-distinctive-styling-for-significant-content/

 You can drag-and-drop an image.

Be careful. The data is on GitHub.
You cannot fine-control it.

26

Advanced Markdown You can use Mermaid```mermaid
graph TD;
A‐‐>B;
A‐‐>C;
B‐‐>D;
C‐‐>D;``````mermaid
gitGraph:
commit "Ashish"branch newbranch
checkout newbranchcommit id:"1111"
commit tag:"test"
checkout maincommit type: HIGHLIGHT
commitmerge newbranchcommitbranch b2
commit``````mermaid
pie title Pets adopted by volunteers"Dogs" : 386"Cats" : 85
"Rats" : 15``````mermaid
xychart‐beta
x‐axis [Apr, May, June, July, August]y‐axis "#accepted paper" 0 ‐‐> 10
bar [3, 4, 1, 5, 8]```

https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-diagrams
https://mermaid.js.org/syntax/examples

27

 History and basics
 Issue Advanced markdown
 Actions Pages Codespaces
 Project
 CLI
 Copilot
28

Actions
 General purpose crowd computational resources.github/workflows/say_hello.yml
name: 'Simply saying hello'on: [push]

Triggered by “push”

jobs:
Use ubuntu
say‐hello:runs‐on: ubuntu‐latest
steps:‐ name: Check out
uses: actions/checkout@v4

You see the results from the browser

Run on a cloud computer!

‐ name: Run basic commands
Copy this repo
run: |
pwd
ls
Let’s run some commands
df‐ name: Say hellorun: |
echo 'Hello World!'

Main job

29

Actions

 Triggered by various signals, e.g., pushing, closing an issue, manual click.
 Free for public repositories! (Thank you, MS….

)

 You can use your own computers (self-hosted runner).
 There are infinite possibilities. You can do various things by combining
GitHub actions with other services.
 Jun Kato will explain a lot in Week 10 (Automation of research andresearch dissemination (Web, Cloud, CI/CD))30

 History and basics
 Issue Advanced markdown
 Actions Pages Codespaces
 Project
 CLI
 Copilot
31

Pages Free website! https://XXXX.github.io/ You can just upload markdown/html to the repository No settings for a domain, physical servers, etc.
‐‐‐
layout: page
title: Summer 2024‐‐‐
# 4840‐1055: Non‐Research Tips for Information
Science Researchers / 情報科学研究補助技法 (Summer
2024)This lecture is offered at the Graduate School ofInformation Science and Technology, Department ofInformation and Communication Engineering, theUniversity of Tokyo. This lecture is tailored for
graduate students majoring in information science.
## News‐ **June 5**: Week 8 slides (invited talk by Prof.
Seaborn) are uploaded.
‐ **May 29**: Week 7 slides (invited talk by Dr.
Bando) are uploaded.
‐ **May 22**: Week 6 slides are uploaded.
‐ **May 8**: Week 5 slides are uploaded.

32

Pages: (case 1) simple markdown
 Put xxx.md in /docs That’s it!
 Configure by /docs/_config.yml, e.g., changing the theme.
docs/hoge.yml

# aaa
‐ xxx
‐ yyy
https://non‐research‐tips.github.io/week9_code/hoge

33Pages: (case 2) build by actions
 (1) Generate html files by actions (2) upload them by actions
 For example,
 The repository contains markdown files only.
 In action, convert markdowns to htmls by running mkdocs.
 In action, upload the generate html files.
 No need to git-manage the generated html files.

https://github.com/matsui528/mkdocs_actions_gh_pages 34

Pages: misc You can directly manage html files if you want.
 Using a special branch (typically, gh-pages) is possible, but may
be a bit old style (now, no need to do so).
 You can host reference of your project as well (readthedocs)
 As a researcher, you can use GitHub pages by Creating your website. If you’re a PhD student, do it now
 Creating a project page for your paper.

35

 History and basics
 Issue Advanced markdown
 Actions Pages Codespaces
 Project
 CLI
 Copilot
36

Codespaces
 Disposable VSCode. Running on a cloud computer.
Accessing via a browser.
 Incredibly useful; you can prepare an isolated environment easily.
 You can test other’s code on codespace.
 When you release your research code, make sure it runs on codespace.

VSCode running on a cloud computer

Terminal

37

Codespaces
 You can configure the codespace by devcontainer
 For example, preparing a Julia environment, which is not installed in
the default codespace.

https://github.com/matsui528/julia_codespace_template38

Codespaces
 You can run browser-based applications
on codespace
 i.e., codespace provides a temporal URL.
 CLIP-based image search with streamlit
https://github.com/matsui528/scs

 Future?: GPU codespace (paid plan) It will change the game…
 Zero-infrastructure AI development
 Coding: GPU codespace Testing: GPU actions

39

 History and basics
 Issue Advanced markdown
 Actions Pages Codespaces
 Project
 CLI
 Copilot
40

Projects
 GitHub provides a kanban (Trello) + Gantt chart

41

Projects
 GitHub provides a kanban (Trello) + Gantt chart42

Projects
 Each item can associate with a corresponding issue.
 You can attach a PR as well.
 GitHub project can be useful for research project management,
especially for a team project.
M. Hammarberg and J. Sunden, “Kanban in Action”,
Manning, 2014.
邦訳：カンバン仕事術，オライリー，2016

43 History and basics
 Issue Advanced markdown
 Actions Pages Codespaces
 Project
 CLI
 Copilot
44

CLI GitHub provides a CLI tool: gh$ gh issue list
Showing 4 of 4 open issues in non‐research‐tips/week9_code
ID
#4
#3
#2
#1

TITLE
aaa
write CVPR draft
implement
come up with a cool research idea

LABELSUPDATED
about 20 minutes ago
about 24 minutes ago
about 25 minutes ago
about 25 minutes ago

 gh can access GitHub internal information (e.g., to show the issuesof a private repository, we need to log in GitHub)
 Sometimes very useful (e.g., if you cannot use ssh for some reasons,gh provodes you a full access to GitHub resources including cloning)45

CLI extension
 GitHub CLI provides a way to extend your own subcommands.
 e.g., $ gh hogehoge
 You can distribute your extension.
 Create a repository. That’s it.
 Install command: $ gh extension install matsui528/gh‐ec2
 Then you can use it: $ gh ec2
I tried the CLI extension right after it was
launched, so I got the critical word “ec2”https://github.com/matsui528/gh-ec2

46

CLI extension
 Providing a command line tool by CLI extension is interesting You can suppose that a tool can access to the GitHub resources.
 It is usually not possible if you create a tool by other ways (e.g.,
Python Fire) Package management system is super simple. Just upload it to
GitHub. One just clones it.

47 History and basics
 Issue Advanced markdown
 Actions Pages Codespaces
 Project
 CLI
 Copilot
48

https://github.blog/2022-06-21-github-copilot-is-generally-available-to-all-developers/

49

Copilot The era of AI-assisted coding has already arrived.
 Whether you want it or not, you need to know what it is.
 To use generative AI such as GitHub Copilot, first follow theguidelines of UTokyo.
 In particular, you need to make sure that you are allowed to use it forsensitive documents, such as class assignments.
https://utelecon.adm.u-tokyo.ac.jp/online/topics/generative-ai

50

Demo
 Copilot Copilot Chat
 Copilot Workspace

51

GitHub helps your research activities:
 History and basics
 Issue -> General purpose. Experiment log.
 Advanced markdown -> Visualization.
 Actions -> Automation.
 Pages -> Project webpage.
 Codespaces -> Test for other’s and yours codes.
 Project -> Kanban for your project.
 CLI -> Fast action.
 Copilot -> Help everything.
52

Schedule
Date (2024)

Contents

Presented by

Week 1, Apr 10

Introduction. Review of fundamental concepts

Yusuke, Koya, Yuki, Jun

Week 2, Apr 17

Equations and pseudo-codes

Yusuke Matsui

Week 3, Apr 24

Presentation

Koya Narumi

Week 4, May 1

Tables and plots

Yusuke Matsui

Week 5, May 8

Figures

Koya Narumi

Week 6, May 22

VideosKoya Narumi

Week 7, May 29

Invited Talk 1

Dr. Yoshiaki Bando (AIST)

Week 8, June 5

Invited Talk 2

Prof. Katie Seaborn (Tokyo Tech)

Week 9, June 12

GitHub in depth

Yusuke Matsui

Week 10, June 19

Automation of research and research
dissemination (Web, Cloud, CI/CD)

Jun Kato

Week 11, June 26

Research community

Jun Kato

Week 12, July 3

3DCG illustrations

Yuki Koyama

Week 13, July 10

Final presentations-

53