GitHub
GitHub is a platform that hosts Git repositories online and adds pull requests, issues, and automation to them. Git manages the versions; GitHub makes working on them together possible.
GitHub is a platform that hosts Git repositories online and adds tools for working together: pull requests, issues, and automatic workflows. Git is the version control program; GitHub is the place where several people work on the same repositories.
Git and GitHub are two things
GitHub's documentation describes it this way itself: GitHub supports software development from planning to operation and builds on Git. Git runs on your computer and needs no network. GitHub keeps another copy of the same repository, a so-called remote, usually under the name origin. With git push you upload commits there; with git fetch and git pull you get those of the others.
On this copy sit the parts that Git alone does not have:
- Pull requests: the request to take a branch into another one, with a description and a discussion. The code review hangs on it.
- Issues: tasks, errors, and wishes that are tracked and linked with pull requests.
- Actions: workflows that start automatically on a change, such as a build and tests. That is continuous integration.
GitHub for .NET and Azure developers
In practice, a .NET project lives on GitHub, and a workflow builds and tests it on every pull request. For delivery to Azure, Microsoft describes the way through OpenID Connect: Microsoft Entra ID has an app registration with federated credentials, GitHub signs in with it, and the repository holds only identifiers such as the tenant and the subscription, no passwords. Visual Studio also offers to create suitable workflows for an Azure target.
This is the same idea as with infrastructure as code: a change goes through a pull request, the check runs automatically, and only then does it go into the main line and into the cloud.
An example from the Kladde
In the course, the Kladde, the sample application of a small IT office, gives its local repository a second home on GitHub. It gets a README, and from then on every step is a pull request, even when you learn alone. Later, the build checks every pull request with tests.
Common misconceptions
- GitHub is not Git. Git keeps working without GitHub, and Git repositories can be hosted with other providers as well.
- A remote is not a backup that needs no care. It contains only what you have uploaded.
- Secrets do not belong in the repository, not even in a private one. Whoever has committed a password once has to treat it as known and replace it.
In the course
You learn this in K1, module 1.7, in the lessons GitHub: the repository online and Pull requests and reviews. Automation with GitHub Actions follows in K3, module 3.7, in the lesson Continuous integration with GitHub Actions.
Further reading on the blog
Sources
- GitHub Docs, About GitHub and Git: https://docs.github.com/en/get-started/start-your-journey/about-github-and-git
- Microsoft Learn, Deploy to Azure infrastructure with GitHub Actions: https://learn.microsoft.com/devops/deliver/iac-github-actions