Remotes and GitHub
A developer's introduction to GitHub
GitHub hosts Git repositories and adds issues, pull requests, Actions, releases, and the collaboration tools teams use daily.
GitHub hosts Git repositories and adds collaboration tools on top.
Git runs on your machine. GitHub stores the shared remote copy. You do not need GitHub to use Git, but most teams publish there.
Repositories
A repository holds files and Git history. It can be public or private.
Clone it locally:
git clone https://github.com/OWNER/REPOSITORY.git
With SSH:
git clone [email protected]:OWNER/REPOSITORY.git
See GitHub’s repository documentation.
Branches and forks
Work on a branch, push it, open a pull request:
git switch -c add-search
git add .
git commit -m "Add search"
git push -u origin add-search
A fork is your copy of someone else’s repository. Use it when you lack write access to the original.
Issues
Issues track bugs and tasks. Link a pull request to close one:
Closes #42
See GitHub’s guide to issues.
Pull requests
A pull request proposes merging one branch into another. Reviewers discuss changes, comment on lines, and run checks before merge.
Draft pull requests help when you want feedback before the code is ready. See GitHub’s pull request documentation.
GitHub Actions
Actions run workflows on events such as push or pull request. Workflows live in .github/workflows/:
name: Test
on:
pull_request:
push:
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: lts/*
cache: npm
- run: npm ci
- run: npm test
Review third-party uses: actions before trusting them. Start with GitHub’s workflow documentation.
GitHub Projects
Projects track issues and pull requests as tables, boards, or roadmaps. See About Projects.
Releases
A tag marks a commit. A release adds notes and downloadable files around that tag. See GitHub’s release documentation.
Webhooks and GitHub Apps
Webhooks notify external services on events. GitHub Apps authenticate with scoped permissions when an integration needs to act on GitHub data. See webhooks and GitHub Apps.
Keep your account secure
Enable two-factor authentication or a passkey. Save recovery codes somewhere safe.
For Git on the command line, use SSH or HTTPS with a token or credential manager. GitHub no longer accepts account passwords for Git over HTTPS.
Give tokens minimal scope, set expiration when you can, and never commit tokens or private keys. See GitHub’s authentication guide.
Lesson completed