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

Deploy Webpage on GitHub: Step-by-Step Guide

This document provides a step-by-step guide to create a GitHub repository and deploy a webpage. It includes instructions for logging into GitHub, creating a new repository, initializing a local repository, adding webpage files, and pushing changes to GitHub. Additionally, it explains how to set the remote origin and pull changes from the remote repository.

Uploaded by

dhivagard089
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)
12 views2 pages

Deploy Webpage on GitHub: Step-by-Step Guide

This document provides a step-by-step guide to create a GitHub repository and deploy a webpage. It includes instructions for logging into GitHub, creating a new repository, initializing a local repository, adding webpage files, and pushing changes to GitHub. Additionally, it explains how to set the remote origin and pull changes from the remote repository.

Uploaded by

dhivagard089
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

Create a repository and deploy the webpage in a GitHub

1. Create a GitHub Repository

1. Log in to GitHub: Go to GitHub and log in.

2. Create a New Repository:

o Click on the "New" button or the "+" dropdown menu in the top-right corner and select "New
repository".

o Repository Name: Choose a name for your repository (e.g., my-webpage).

o Visibility: Select Public or Private.

o Click Create Repository.

3. Initialize a Local Repository


o Navigate to your local project folder in your terminal : cd/path/to/your/local/project
o Initialize Git in the folder: git init

4. Add Webpage Files

1. Create your webpage files (e.g., [Link], [Link], etc.).

2. Copy the files to the repository folder.

4. Push Changes to GitHub

1. Stage the files: git add .

2. Commit the changes: git commit -m "Add initial webpage files"

4. Add Remote Origin

1. Add the remote origin URL from GitHub: git remote add origin
[Link]

Replace your-username with your GitHub username and my-webpage with your repository name.

‘git remote add origin ’ specifies that we are adding a remote repository, with the specified URL, as an origin to
our local Git repo.

5. Push to GitHub

1. Push the local repository to GitHub:

git branch -m main

git push origin main

6. Pull local repo from GitHub :-


Git pull is used to pull all changes from a remote repository into the branch we are working on. It is a
combination of fetch and merge. Use it to update your local Git.
git pull origin main

You might also like