Codele / How software is built
Git and GitHub
A game lets you save before a risky fight. Git does the same for your code: save points you can return to, side copies to experiment on, and a shared copy online.
- A commit is a snapshot of your files with a message. The history is a chain of commits.
- Staging (git add) chooses which changes go into the next commit.
- A branch is a side copy to experiment on. Merge brings it back; deleting it throws it away.
- Git lives on your computer. GitHub is a website that holds a shared copy; push sends your commits there. Make an empty repository on GitHub first and copy its address.
Loading the playable lesson…