bf-workflows

GitHub

What is GitHub?

GitHub is a web-based platform for hosting and managing Git repositories, enabling seamless collaboration among developers.

Key Features of GitHub

GitHub Repositories

A repository (repo) is a central place where all the files of a project are stored. Each repository on GitHub contains all the project files and stores each file’s revision history.

Key Concepts and Terminology

Getting Started with GitHub

  1. Sign Up: Create a GitHub account at github.com.
  2. Create a Repository:

    • Click on the + icon in the top-right corner and select “New repository”.
    • Fill in the repository name and description.
    • Choose the repository visibility (public or private).
    • Click “Create repository”.
  3. Clone a Repository:

    • Copy the repository URL.
    • Use the following command to clone the repository to your local machine:

      git clone https://github.com/username/repository.git
      
  4. Adding and Committing Changes:

    • Make changes to your files.
    • Stage the changes:

      git add .
      
    • Commit the changes with a descriptive message:

      git commit -m "Add new feature"
      
  5. Pushing Changes:

    • Push your changes to the remote repository:

      git push origin main
      
  6. Creating a Branch:

    • Create and switch to a new branch:

      git checkout -b new-branch
      
  7. Opening a Pull Request:
    • Navigate to your repository on GitHub.
    • Click on the “Pull requests” tab.
    • Click the “New pull request” button.
    • Compare your branch with the base branch.
    • Click “Create pull request” and provide a title and description.

Additional GitHub Features

Best Practices for Using GitHub