Github
General
Github Basics

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

  1. Go to GitHub (opens in a new tab).
  2. Click Sign up.
  3. Enter your email, username, and password.
  4. 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

  1. Navigate to GitHub and click the + icon.
  2. Select New repository.
  3. Enter a name, description, and choose visibility settings.
  4. Click Create repository.

Forking a Repository

  1. Open the repository you want to fork.
  2. Click Fork in the top-right corner.
  3. 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

  1. Navigate to the repository.
  2. Click Issues > New issue.
  3. Enter a title and description.
  4. 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

  1. Navigate to the repository and switch to your branch.
  2. Click Pull requests > New pull request.
  3. Compare changes and add a title & description.
  4. 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

  1. Go to the Actions tab.
  2. Click New workflow.
  3. Choose a template or create a .github/workflows/main.yml file.
  4. Define jobs and steps for automation.

GitHub Pages

Deploying a GitHub Pages Site

  1. Go to Settings of the repository.
  2. Scroll to the GitHub Pages section.
  3. Choose the source branch and save.
  4. 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).


Powered by Nextra