MCS 275 Spring 2023
Emily Dumas
Reminders and announcements:
We discussed enough of the version control system git to allow a solo project to maintain a documented, linear, history of changes.
git init
git status
(optional)git add file1
git add file2
git status
(optional)git commit
git log
git show COMMIT:FILE
A set of changes with a single purpose.
Usually that means a small number of changes.
(If several things changed, git add --patch
will let you stage just part of the changes.)
Launched in 2008 ($\approx$3 years after git released).
By 2013, hosted 5 million repositories.
Google's competitor (Google Code) shut down in 2015.
GitHub acquired by Microsoft in 2018.
Over 370 million repositories as of January 2023.
GitHub hosts official repositories (or mirrors) for
Monoculture can be dangerous.
GitHub is becoming a single point of failure in software development.
But of course I want to teach the tools people use!
Suppose you want to host a local* git repo on GitHub.
push
from local repository to GitHub* I recommend you always make a repo locally before putting it on GitHub.
git push
Contact a remote repository and send it commits that are in our database but not theirs.
Fails if remote has changed since our last push!
GitHub main interface shows file/dir list and renders any README.md (or README.txt).
Has syntax highlighting, can render .ipynb
files, ...
Can browse commits, view repo at previous state, ...
It is possible to add/edit files directly on GitHub.
These actions create new commits.
Using this feature is rare in most projects.
git pull
Contact a remote repository and get commits from its database that are not yet in ours.
May trigger a merge if there have been changes to both local and remote since we last pulled.
Branching workflow.