RSH 25: Intro to Github
What is Github and why would you use it?
Collaborative notes taken during the session
Intro to Github
This event was put on with support of the Aalto Research Services
Progression of use cases and topics
GitHub is used for:
- things for yourself (central location, backup, sharing, organizing, easy moving to later levels)
- things for small groups (organizations, shared repos with or without PRs, etc)
- things for community (outside collaborators, discussion, PRs, etc)
Where are you? Where do you want to be?
I have used git before:
- yes: IoooooOooooIoooo
- no: Ooooooo0oooo
In the past I have already opened an issue on GitHub:
- yes: oIIoooIII
- no: OoOoooooooooooooo0ooo
In the past I have already creaded a pull request on GitHub (or merge request on GitLab):
- yes: ooooIooIo
- no: oOooooooooooooooo
What is git?
- Version control
- Track changes
- Inspect history
- Work together
- Basically a requirement for any kind of serious programming work
- But also useful for others.
- This talk is not about git: we assume you use it already
- tracks code, manuscripts, theses, etc.
What is GitHub?
- Commercial company
- ... hosting a web repository, Github
- Very good free services for open-source projects.
- vs Gitlab
- Gitlab is open-source equivalent
- Many universities have their own (e.g. version.aalto.fi, source.coderefinery.org)
- For the most part, usage is the same.
- Interfaces: take your pick
- Git command line
- Github desktop and apps
- Github web interface
- Github ownership
Question: Are there command line interfaces for Github that work on Windows?
- For git itself, Git for Windows. / gitbash https://gitforwindows.org/
- This has some nice extra features (not just for Windows btw)
I don't know if it's changed, but last time I checked, the Github Desktop was pretty unstable in Windows.
Basic features: pushing and pulling
Let's demo the basics of Github.
- You connect to other servers via git remotes, controlled with
- Once a remote is set, you
git fetch, and
- It isn't our goal to go in detail about the technical implementation: you can read this later. (we'll talk about why instead)
- New repository
- Create repository on Github
- Add remote
- Push to Github
- git log
- git remote -v
- git push origin master
Git for small groups
- The next level is using Github among a research group, or something similarly small.
- To be a group, you need to work together. To work together, you need a place to do so.
- User management: share among a group
- Issues: Track things to do
- Pull requests: Code review
Question: I work with Jupyter Nitebooks. Is there an easy way to integrate those into github? thanks
- great question! I use this locally (nice tool to visually diff and merge notebooks): https://nbdime.readthedocs.io/ but I don't know of a good way to see nice diffs directly on GitHub. I anticipate that GitHub is working on that. Anybody knows some solution?
- Yeah, diffs not so good right now. I haven't heard of much beyond that, but many people do use git for notebooks, just realize that diffing and merging isn't so easy.
- the nbdime is great locally for this but would be nice to see it directly in pull requests +1
- So you have your own group working well. What comes next? The community
- There is little cost to accepting contributions from others.
- Minimizing information overload in big community projects.
- Importance of a license file
- Don't accept contributions until you get this clarified
- How to contribute
- Issue templates, pull request templates, etc.
- Code of conduct
- It's actually important that issues are not generally viewed as "problems" but more as improvement ideas, etc. cause otherwise some people tend to try to avoid having issues listed.
Long term: archiving and Zenodo
- Github is the de-facto source for open research software (for better or for worse)
- Can you cite it in a paper?
- Can you expect Github to be around in 20 years?
- More likely than your university's Gitlab or personal webpage. (But does your user still exist?)
- For permanent storage, connect to Zenodo and publish releases.
- Zenodo is a EU-funded repository of science.
Video demo of Zenodo link: https://www.youtube.com/watch?v=Atp-GmhS7gY
- Github Actions are continuous integration: they can run tests on every commit.
- Automatic testing on changes: great for making sure things work!
- Automatic deployment, for example push to git and a website gets updated.
- CodeRefinery courses: https://coderefinery.org/lessons/
- git-intro (by yourself)
- git-collaborative (Github + pull requsets)
- Automated testing: Github Actions
- Research Software Hour: https://researchsoftwarehour.github.io/
- Aalto Research Software Engineers: https://scicomp.aalto.fi/rse/
- Coderefinery chat: https://coderefinery.zulipchat.com/
One good thing about today:
- The demos were helpful! Thank you!
- Great introduction! Thank you!
One thing to be improved: