Git Basics and Single-Person Workflow
- Git is a version control system that tracks changes to files over time.
- GitHub hosts git repositories in the cloud and adds collaboration features.
- The core workflow is: pull → edit → commit → push.
- Good commits are small, focused, and have clear messages.
- Use
.gitignoreto keep unwanted files out of your repository.
Collaboration, Branching and Pull Requests
- Git can auto-merge changes to different parts of a text-based file.
- A merge conflict occurs when the same lines are changed by two people.
- The
mainbranch typically represents the stable version of the project. - Branches let you work in parallel and independently without
affecting
main. - Pull requests provide a review and discussion workflow before merging branches.
Problems, Safety, and GitHub Hygiene
- Git does not track empty directories — use
.gitkeepas a placeholder. - Use Discard changes for uncommitted edits and Revert for commits.
- Never commit secrets; rotate any that are accidentally pushed.
- Protected branches enforce a pull request workflow.
- Issues help organise work; use clear titles, descriptions, and labels.
Publishing and Automation
- GitHub Pages publishes a website directly from your repository.
- Tags mark specific commits; releases add notes and downloadable archives.
- Zenodo can archive GitHub releases and assign DOIs for academic citation.
- GitHub Actions automate tasks (testing, building, checking) triggered by repository events.
- A workflow is a YAML file in
.github/workflows/that defines automated jobs.