0% found this document useful (0 votes)
0 views

git and github demo

This document provides a step-by-step guide for setting up Git and connecting it to a GitHub account. It includes instructions for checking Git installation, creating a GitHub repository, configuring Git with user information, initializing a local project, and pushing files to GitHub. The guide also covers creating essential website files and staging them for commit.

Uploaded by

nirmala.mca
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
0 views

git and github demo

This document provides a step-by-step guide for setting up Git and connecting it to a GitHub account. It includes instructions for checking Git installation, creating a GitHub repository, configuring Git with user information, initializing a local project, and pushing files to GitHub. The guide also covers creating essential website files and staging them for commit.

Uploaded by

nirmala.mca
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

Git Setup (Your Computer):

1. Check Git: Open your terminal (Git Bash on Windows) and type git --version. If you see a version number, Git is installed. If no
proceed to the next step.

Goto the command prompt

C:\Users\admin>git --version
git version 2.47.1.windows.2

GitHub Account (Online):

Sign Up: Go to
https://github.com/ and
create a free GitHub
account.

I already had an account

Login: Log in to your GitHub


account.

Dashboard of my github
Create Repository: Click the
"+" button (usually in the
top right) and select "New
repository."

 Give your repository a


name (e.g., recipe-website).
 Add a description
(optional).

You can choose to initialize


the repository with a
README file (good practice).
 Click "Create repository."
Click Create Repository
Setting up the Local Project and Connecting to GitHub:

Create Project Folder: E:\NIRMALA\D DRIVE NIRMALA\FULL STACK DEVELOPMENT\GITGITHUBDEMO


On your computer, create a
folder where you will store
your website files (e.g.,
recipe-website).
Open Terminal/Git Bash: GOTO TO GITBASH
Open your terminal or Git
Bash and navigate to the
newly created folder using
the cd command (e.g., cd
recipe-website).

Use CD command to move admin@DESKTOP-L3UNO55 MINGW64 ~ (master)


to the working directory $ git

Pwd gives the present admin@DESKTOP-L3UNO55 MINGW64 /e/NIRMALA/D DRIVE NIRMALA/FULL STACK
working directory DEVELOPMENT/GITGITHUBDEMO
$ pwd
/e/NIRMALA/D DRIVE NIRMALA/FULL STACK DEVELOPMENT/GITGITHUBDEMO

Goto the receipe-website $ cd receipt-website

Pwd admin@DESKTOP-L3UNO55 MINGW64 /e/NIRMALA/D DRIVE NIRMALA/FULL STACK


DEVELOPMENT/GITGITHUBDEMO/receipt-website

Git Configuration: Tell Git your name and email address:

git config --global user.email $ git config --global user.email "[email protected]"


"[email protected]"

To check whether email is $ git config --global user.email


globally set

git config --global user.name $ git config --global user.name "nirmalagitty"


"Your Name"
To check $ git config --global user.name

Initialize Git: Initialize Git in your project folder:

Bash
git init

Create Website Files: Create


the following files in your
recipe-website folder and
paste the code into them:

index.html <!DOCTYPE html><html><head>


<title>Recipe Website</title>
<link rel="stylesheet" href="styles.css">
</head><body><h1>Welcome to Our Recipe Website</h1>
<nav><a href="recipes.txt">View Recipes</a></nav>
<p>Delicious recipes for everyone!</p><footer>&copy;
2023 Our Recipe Website</footer></body></html>
styles.css body {font-family: sans-serif;margin: 20px;
background-color: #f0f0f0;}
h1 {color: #333;}nav a {margin-right: 10px;
text-decoration: none;color: #007bff;}
footer {margin-top: 20px;
text-align: center;color: #777;}
Recipes.txt Chocolate Cake

Ingredients:
- Flour
- Sugar
- Cocoa powder
- Eggs
- Milk

Instructions:
1. Mix ingredients...
2. Bake...
Spaghetti with Meatballs

Ingredients:
- Spaghetti
- Ground beef
- Tomato sauce
- Onions
- Garlic

Instructions:
1. Cook spaghetti...
2. Make meatballs...
3. Combine...
Output of browser window

Add Files to Git: Stage the git add . # Adds all files in the current directory
files for commit:

To know the status git status


Commit Changes: Create a git commit -m "INITIAL WEBSITE FILES"
commit (snapshot) of the
files:

Add Remote (Connect to GitHub): Copy the URL of your repository from GitHub (it will look like
https://github.com/YourUsername/recipe-website.git). Then, in your terminal:

git remote add origin <your_github_repo_url>

$ git remote add origin “https://github.com/nirmalagitty/receipe-website”

Push to GitHub: Upload git push -u origin master


your local commits to
GitHub:

You might also like