GITHUB · FOUNDATIONS
GitHub basics: Git, repositories, pull requests and collaboration
GitHub hosts Git repositories and supports collaboration around them. Git records history; GitHub brings together discussion, review and checks. Learn to distinguish storing history, exposing it publicly and approving a change.
Explain the roles of Git and GitHub and distinguish visibility, branches, pull requests and permissions.
A commit records content; a branch names a history position. The SQL change from the Git lesson is reviewed here so you can follow the example.
Where do Git and GitHub differ?
Manage working files, the index, commits and branches.
Host shared history with explicit visibility and permissions.
Propose integration and collect the diff and discussion.
Use human judgment and automated validations to assess integration.
Sharing history and approving a change are distinct. Having a GitHub repository does not by itself deploy changes.
A repository holds project files and revision history. In the fictional name demo-acme/report-infra, demo-acme is the owner and report-infra is the repository name. GitHub adds ways to discuss and manage work around that history.
Separate visibility from permission to act
| Decision | What to establish |
|---|---|
| Who can see it? | Public content is broadly readable; private access is restricted. Available visibility options depend on the account and plan. |
| Who can act? | Check read, update, administration and review rights, together with protection rules. |
Private visibility is not a safety verdict on contributed code. Authorized contributors can still make mistakes or act maliciously. Committed secrets may remain accessible through history and copies. Keep sensitive values out of commits and constrain runtime privileges.
Propose a branch change with a pull request
Suppose main points at original B and feature/jp-report-filter at proposed H. H adds region = JP to an approved-report query. Recording a change on a branch differs from integrating it into main. B and H are teaching labels.
Fictional PR #42 asks whether to integrate H into main. Read the diff in Files changed, discussion in Conversation, proposed history in Commits and validations in Checks. If approved US report R-B disappears, ask whether that meets the requirement.
| Decision | Meaning |
|---|---|
| Comment | Leave feedback without an approval or change-request decision. |
| Approve | Support integration; this is separate from merging or deploying. |
| Request changes | Identify changes that should be addressed before integration. |
A successful automated check is not a human requirements decision. Assess integration against the current diff, required reviews and checks, permissions and configured bypasses. Opening a PR establishes neither approval nor a merge.
Reading a contribution differs from executing it
A fork is a separate repository sharing history with an upstream repository, and can be used to propose contributions. Readable source on GitHub is still untrusted until reviewed; do not infer authority to run it with privileges.
- Review workflow, dependency and execution-destination changes as well as SQL or configuration.
- Identify who receives secrets or tokens and what the runner can reach.
- Keep visibility separate from reviewed, tested and deployed states.
Check the role of GitHub
Choose an option to see the result and explanation.
Check, then explain in your own words
- Name one role for local Git and one for GitHub.
- Separate private visibility from permission to execute a contribution.
- Distinguish a PR proposal, review approval and merge.
Check your understanding: May an unreviewed PR receive deployment privileges because its repository is private?
No. Visibility and trust in executable code are separate decisions.
Private restricts visibility. Access to runners and credentials depends on reviewed changes and execution privileges.
Sources and conditions checked
Primary references are collected here with their scope, conditions and corresponding sections. Independent expert review and live-environment validation have not been performed.
- GitHub: About repositoriesChecked:
Scope and conditionsRepository history, collaboration and visibility; GitHub.com scope. Documentation review, not live-environment validation.
Used in this lessonWhere do Git and GitHub differ? Separate visibility from permission to act Check the role of GitHub
- GitHub: Pull requestsChecked:
Scope and conditionsProposals, PR views and merge refs; current base tip versus common ancestor. Documentation review, not live-environment validation.
Used in this lessonWhere do Git and GitHub differ? Propose a branch change with a pull request Reading a contribution differs from executing it
- GitHub: About protected branchesChecked:
Scope and conditionsPlan, visibility and configured checks, reviews and stale approval handling. Documentation review, not live-environment validation.
Used in this lessonSeparate visibility from permission to act Propose a branch change with a pull request Check the role of GitHub
Scope and conditionsUntrusted code and privileged contexts, secrets, third-party actions and persistent self-hosted state. Documentation review, not live-environment validation.
Used in this lessonSeparate visibility from permission to act Reading a contribution differs from executing it Check the role of GitHub
Scope and conditionsEnvironment protection availability depends on plan and visibility. Documentation review, not live-environment validation.
Used in this lessonSeparate visibility from permission to act
- GitHub: Pull request reviewsChecked:
Scope and conditionsComment, Approve and Request changes decisions. Documentation review, not live-environment validation.
Used in this lessonPropose a branch change with a pull request