0% found this document useful (0 votes)
6 views2 pages

How to create repository

This document provides a step-by-step guide on creating a new repository on GitHub, including logging in, filling in repository information, and cloning it locally. It also details how to make changes, commit them, and push updates to GitHub, along with instructions for enabling GitHub Pages. The guide ensures users can successfully host a website using their repository.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views2 pages

How to create repository

This document provides a step-by-step guide on creating a new repository on GitHub, including logging in, filling in repository information, and cloning it locally. It also details how to make changes, commit them, and push updates to GitHub, along with instructions for enabling GitHub Pages. The guide ensures users can successfully host a website using their repository.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

How to create repository:-

Certainly! I'll guide you through the steps to create a new repository on GitHub using the current
interface and perform some basic Git commands.

### Create a New Repository on GitHub:

1. **Log in to GitHub:**
Open your web browser and go to [GitHub](https://github.com/). Log in with your account if you're
not already logged in.

2. **Create a New Repository:**


- Click on the "+" sign at the top right corner of the GitHub page.
- Select "New repository" from the drop-down menu.

3. **Fill in Repository Information:**


- Choose a name for your repository (e.g., `coursera-test`).
- Optionally, add a description.
- Keep the repository public (since private repositories require a paid plan).
- Initialize this repository with a README file.

4. **Create Repository:**
- Click the "Create repository" button.

### Clone the Repository Locally:

Now, let's clone the repository to your local machine and make some changes.

1. **Copy the Repository URL:**


- On the GitHub repository page, click the "Code" button.
- Copy the HTTPS URL.

2. **Open Terminal or Command Prompt:**


- Navigate to the directory where you want to clone the repository using the `cd` command.

3. **Clone the Repository:**


- Run the following command:
```bash
git clone <repository_url>
```
Replace `<repository_url>` with the URL you copied.

4. **Navigate to the Repository:**


- Move into the repository directory:
```bash
cd coursera-test
```

### Make Changes and Push to GitHub:

1. **Edit or Add Files:**


- Use a text editor to create or modify files in the repository.
2. **Add and Commit Changes:**
- Stage the changes:
```bash
git add .
```
- Commit the changes with a commit message:
```bash
git commit -m "Updated index.html"
```

3. **Push Changes to GitHub:**


- Push the changes to the GitHub repository:
```bash
git push origin main
```
Replace `main` with the name of your branch if it's different.

### GitHub Pages:

Follow the steps you mentioned in the tutorial to enable GitHub Pages for your repository. This
involves going to the repository's settings, scrolling down to the "GitHub Pages" section, and
launching the Automatic Page Generator.

Remember, GitHub Pages uses the `gh-pages` branch. If you want to update your website, make
changes in that branch and push them.

Now you should have a functional GitHub repository with GitHub Pages hosting your website. If you
encounter any issues or have further questions, feel free to ask!

You might also like