Skip to main content

How to Set Up a GitHub Repository

In order to set up a GitHub repository, you will need to follow these steps:

Step 1: Create a GitHub Account

  1. Go to the GitHub website and sign up for an account if you don't already have one.
  2. Verify your email address.

Step 2: Create a New Repository

  1. Once you are logged in to your GitHub account, click on the "+" icon in the top right corner of the page and select "New repository".
  2. Give your repository a name and a short description.
  3. Choose whether you want your repository to be public or private.
  4. Select "Initialize this repository with a README" if you want to create a README file for your repository.

Step 3: Add Files to Your Repository

  1. Once you have created your repository, you can start adding files to it.
  2. Click on the "Add file" button to create a new file or upload an existing file.
  3. If you are uploading an existing file, you can drag and drop the file into the "Drag files here to add them to your repository" box.

Step 4: Commit Changes

  1. Once you have added or edited files in your repository, you will need to commit your changes.
  2. Enter a brief description of your changes in the "Commit changes" box.
  3. Click the "Commit changes" button.

Step 5: Push Changes to GitHub

  1. Once you have committed your changes, you will need to push them to GitHub.
  2. Open the command line on your computer and navigate to the directory where your repository is stored.
  3. Enter the following command to push your changes to GitHub:

git push origin main

And that's it! Your GitHub repository is now set up and ready to use. You can continue to add files and make changes to your repository as needed.