GitHub Basics Documentation
Introduction
GitHub is a cloud-based platform for version control and collaboration. It allows multiple developers to work on projects simultaneously while tracking changes using Git. This guide covers the essential features of GitHub.
Getting Started
Creating a GitHub Account
- Go to GitHub (opens in a new tab).
- Click Sign up.
- Enter your email, username, and password.
- Follow the prompts to verify your email and set up your profile.
Setting Up GitHub CLI
Windows (using Scoop)
scoop install gh
To authenticate:
gh auth login
Repositories
Creating a Repository
- Navigate to GitHub and click the + icon.
- Select New repository.
- Enter a name, description, and choose visibility settings.
- Click Create repository.
Forking a Repository
- Open the repository you want to fork.
- Click Fork in the top-right corner.
- The forked repository will appear in your account.
Cloning a Repository
To clone a repository locally:
git clone <repository-url>
GitHub Issues
Creating an Issue
- Navigate to the repository.
- Click Issues > New issue.
- Enter a title and description.
- Click Submit new issue.
Managing Issues
- Assign labels to categorize issues.
- Mention users with
@username
. - Close issues when resolved.
Pull Requests
Creating a Pull Request
- Navigate to the repository and switch to your branch.
- Click Pull requests > New pull request.
- Compare changes and add a title & description.
- Click Create pull request.
Reviewing a Pull Request
- Leave comments on lines of code.
- Request changes if necessary.
- Approve and merge when ready.
GitHub Actions
Setting Up a Workflow
- Go to the Actions tab.
- Click New workflow.
- Choose a template or create a
.github/workflows/main.yml
file. - Define jobs and steps for automation.
GitHub Pages
Deploying a GitHub Pages Site
- Go to Settings of the repository.
- Scroll to the GitHub Pages section.
- Choose the source branch and save.
- Access the site at
https://<username>.github.io/<repository>
.
Conclusion
GitHub is a powerful platform for version control and collaboration. For more details, visit the GitHub Docs (opens in a new tab).