- What is
GitHub - The
GitHubsite GitHubAPIGitHubaccountGitHubrepository- Repository owner
- Fork
- Issue
- Pull request
- Create a pull request in your fork
- Label
- Settings
- Personal access token (PAT)
GitHub flowGitHub ProjectsGitHub Actions- Secrets
- File preview
gh- Troubleshooting
GitHub is a web-based platform for hosting Git repositories and collaborating on software projects.
It extends Git with features such as issues for tracking tasks and bugs, pull requests for proposing and reviewing changes, and GitHub Actions for automating workflows.
Docs:
The GitHub site has this URL: https://github.com.
The GitHub API is a REST API that lets programs interact with GitHub resources — repositories, issues, pull requests, and more — without using the GitHub site.
Requests to the GitHub API are authenticated using a personal access token (PAT).
Docs:
A GitHub account is a registered user or organization profile on the GitHub site.
With a GitHub account, you can create and manage GitHub repositories, open issues, submit pull requests, and collaborate with others.
A GitHub username is a unique identifier of a GitHub account — a user or an organization — on the GitHub site.
Important
The username doesn't include @.
Example: inno-se-toolkit.
Your GitHub username (without @).
- Go to the
GitHubsite. - Sign in if necessary.
- You'll see your username in the top left corner.
A GitHub repository contains not only project files but also additional collaborative features such as:
- issues for tracking bugs and tasks
- pull requests for code review and merging changes
- Projects for organizing work
A GitHub repository name.
The name must be unique among repositories of the repository owner.
We use <repo-url> to refer to a repository URL.
A repository URL is typically https://github.com/<repo-owner-github-username>/<repo-name>.
Placeholder values:
- See
<repo-owner-github-username>. <repo-name>is the name of the repository.
In Git, upstream is the conventional name for the remote that points to the original GitHub repository that was forked.
In Git, origin is the conventional name for the remote that points to your own copy of the GitHub repository — typically your fork.
For example, if your fork URL is <your-fork-url>, then origin points to that URL.
You can verify which URLs origin and upstream point to by inspecting remotes.
You can browse a repository at a particular revision: <repo-url>/tree/<revision>.
Replace:
<repo-url><revision>at the end of the URL with the actual revision.
Example: https://github.com/nixos/nixpkgs/tree/nixpkgs-unstable
- If you don't see
Publicnear your repo name, make your repo public.
Repository owner is a GitHub account where the repo is currently stored.
GitHub username of the repository owner.
A fork is a copy of an original project repository on GitHub that allows you to freely experiment with changes without affecting the original project repository.
When you fork a repository on GitHub, you create a personal copy under your GitHub account where you can make modifications, test features, and propose changes back to the original repository through pull requests.
- Go to
GitHub. - Go to the repo that you want to fork.
- Click
Fork.- Click
Choose an owner. - Click
<your-github-username>to make you the repo owner. - Click
Create fork.
- Click
Assume the URL of the repo that you forked is https://github.com/<repo-owner-github-username>/<repo-name>.
Then, your fork URL should look like https://github.com/<your-github-username>/<repo-name>.
See also:
- Open
<your-fork-url>in a browser.
A GitHub issue is a unit of work or discussion related to a GitHub repository.
Issues are used to track tasks, bugs, enhancements, feature requests, and other activities related to a project.
They serve as a centralized place for collaboration and communication around specific topics or work items.
- A descriptive title that summarizes the topic
- A detailed description explaining the problem, task, or idea
- Labels to categorize and prioritize the issue
- Assignees who are responsible for addressing the issue
- Comments for ongoing discussion and updates
- Milestones to group related issues together
- Reactions (like 👍, 👎) to gauge community sentiment
Issues can be created by repository collaborators or by anyone with access to the repository (if the repository allows public issues).
They are an essential part of the GitHub flow, allowing teams to plan, discuss, and track work effectively.
A repository owner can provide issue forms so that users are forced to create issues in a given format.
Examples of issue forms:
Lab Taskdefined in.github/ISSUE_TEMPLATE/01-task.ymlBug Reportdefined in.github/ISSUE_TEMPLATE/01-task.yml
-
Go to
GitHub. -
Go to the repo where you want to create an issue.
-
Click
Issues. -
Click
New Issue. -
Click one of the suggested issue forms.
-
In the
Add a titleinput field, edit the title. -
Fill out other input fields.
-
Click
Create.
The base repository is the GitHub repository into which the changes are merged.
When creating a pull request from a fork, the base repository can be the fork itself or the upstream repository that was forked.
The head repository is the GitHub repository that contains the changes you want to merge.
When creating a pull request from a fork for the cours e labs, the head repository is your fork, not the upstream repostory.
The default branch is the primary branch of a GitHub repository, typically named main.
New pull requests and code merges target the default branch by default.
The base branch is the branch in the base repository that you want to merge your changes into.
The compare branch (also called the "pull request branch" or "head branch") is the branch that contains the changes you want to merge into the base branch.
A placeholder for the name of the compare branch.
- Method 1: Open the PR editor using a button
- Method 2: Open the PR editor using
Pull requests - Method 3: Open the PR editor using the branch list- Finish creating a PR
-
If you see the
Compare & pull requestbutton, click it.Otherwise, open the PR editor using another method.
- Go to your fork.
- Click
Pull requests. - Click
New pull request. - Select your fork as the base repository:
- Click
base repository: <repo-owner-github-username>/<repo-name>. - In
Filter repos, write<your-github-username>. - Click
<your-github-username>/<repo-name>to select your fork.
- Click
- Select
mainas the base branch:- Click
base: <branch>. - In
Find a branch, writemain. - Click
mainin the list.
- Click
- Select
<compare-branch>as the compare branch:- Click
compare: main. - In
Find a branch, write<compare-branch>. - Click the
<compare-branch>in the list.
- Click
- Click
Create pull request.
- Go to your fork.
- Click
mainunder the repo name to view all branches. - Click
<branch>that you want to use for PR. - You'll see the
Contributebutton if the branch has commits that aren't yet in themainbranch. - Click
Contribute. - Click
Open pull request.
-
Write the PR title.
-
Write the PR description.
-
Link the PR to the issue, e.g.
Closes #<issue-number>.Note: linking an issue works only for PRs that have the repo default branch as the base branch.
-
Check the boxes under the PR description.
-
Click
Create pull request.
A label helps you filter and organize issues.
- Go to your fork.
- Go to
Issues->Labels. - Create a new label:
- Click
New label. - Name:
<label-name>. - Click
Create label.
- Click
- Go to your fork.
- Add the
<label-name>label to some of your issues.
- Go to your fork.
- Go to
Issues. - If you don't see any
Openissues, clickClosed. - Filter issues by the label:
- Click
Labels. - In the
Filter labelsinput area, write<label-name>. - Click the suggested label.
- Click
- You should see all issues that have the
<label-name>label.
-
Go to
Settings->General->Features. -
Check the box near
Issues. -
You should see the
Issuestab. Example:
- Go to your fork.
- Go to
Settings->Collaborators->Add people. - Add the person as a collaborator.
- Make sure the collaborator has accepted the invitation sent to their email.
-
Go to
Settings. -
Go to
Code and automation. -
Click
Rules. -
Click
Rulesets. -
Click
New ruleset. -
Click
New branch ruleset. -
Set:
Ruleset Name:pushEnforcement status:ActiveTarget branches->Add target->Include default branchBranch rules:-
Restrict deletions -
Require a pull request before merging:Required approvals:1Require conversation resolution before mergingAllowed merge methods:Merge.
- Block force pushes
-
A personal access token (PAT) is a credential that authenticates you to GitHub in place of a password.
PATs are used when accessing GitHub over HTTPS — for example, when pushing to a GitHub repository from the command line or making requests to the GitHub API.
-
Open in a browser https://github.com/.
-
Click your profile icon in the top right corner.
-
Click
Settings. -
Scroll down until
Developer settingsin the left sidebar. -
Click
Developer settings. -
Click
Personal access tokens. -
Click
Tokens (classic). -
Click
Generate new token. -
Click
Generate new token (classic). -
Write a note.
-
Go to
Select scopes. -
Check the marks near:
repoworkflow
-
Scroll to the bottom of the page.
-
Click
Generate token.
GitHub flow is a process for organizing the work on a repository.
It can be used both by individual developers and teams.
See GitHub flow.
GitHub Projects is a project management tool integrated directly into GitHub that helps you plan, track, and manage your work. With GitHub Projects, you can create boards to organize issues, pull requests, and notes in a customizable workflow.
Key features of GitHub Projects include:
- Boards: Visual Kanban-style boards to track work items across different stages (e.g., To Do, In Progress, Done)
- Automation: Built-in automation rules to move items between columns based on status changes
- Views: Multiple view options including board, table, and roadmap views
- Integration: Direct integration with issues and pull requests in your repositories
- Custom fields: Ability to add custom fields to track additional information like priority, team, or estimates
- Templates: Pre-built templates for common workflows like Agile, Scrum, or basic task tracking
GitHub Projects can be scoped to a single repository or span multiple repositories, making it ideal for managing work across entire organizations or teams.
You can use Projects to plan sprints, track bug fixes, manage feature development, or coordinate any other collaborative work.
GitHub Actions is a CI/CD platform built into GitHub that runs automated workflows when events happen in a GitHub repository — for example, on every push to main.
Workflows are defined as YAML files in .github/workflows/.
Docs:
A GitHub secret is an encrypted environment variable stored in a GitHub repository. Secrets are used to store sensitive values like API keys, passwords, and tokens so they are not exposed in workflow files.
Secrets are accessed in workflow files as ${{ secrets.SECRET_NAME }}.
- Go to your fork.
- Go to
Settings→Secrets and variables→Actions. - Click
New repository secret. - Enter the secret name and value.
- Click
Add secret.
In a code block, click the copy icon to copy the block of code.
Code block example:
ls .
gh is a CLI for interacting with GitHub.
You can allow your coding agent to use gh to automate work with GitHub.
Complete these steps:
- Method 1: Install
ghusingNix - Method 2: Install using the official instructions
-
Install
Nixif not yet installed. -
nix profile install nixpkgs#gh
-
To check that
ghworks,gh --versionThe output should be similar to this:
gh version 2.87.3 (nixpkgs) https://github.com/cli/cli/releases/tag/v2.87.3
-
To authorize
ghto use your [GitHubaccount],gh auth login -
Select
GitHub.comusing the keyboard (UpArrow,DownArrow). -
Select
HTTPSusing the keyboard (UpArrow,DownArrow). -
When prompted
Authenticate Git with your GitHub credentials? (Y/n), typey. -
Select
Login with a web browserorPaste an authentication token. -
Follow the instructions to complete the authentication.
-
Create a
GitHubPAT if you don't have one. -
Paste it to the shell.
🟦 Note
The shell won't show what you pasted for security reasons.
There is already a possibly outdated version of the GitHub repository.
Option 1: Remove it.
-
To remove the directory at
<directory-path>:-
sudo rm -r <directory-path>Replace the placeholder
<directory-path>with the path from the error message (without<and>).
-
-
Clone again.
Option 2: Update the <branch>.
-
To enter the directory at
<directory-path>,cd <directory-path>Replace the placeholder
<directory-path>with the path from the error message (without<and>).



