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

Introduction To Git Github

Uploaded by

Amith G Nair
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Introduction To Git Github

Uploaded by

Amith G Nair
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

Introduction to

Git & Github


Distributed version control
system to track changes in
source code.
Key Features: Benefits:
Tracks changes to files over time.
Facilitates efficient teamwork.
Enables collaboration across
teams.
Prevents code conflicts.
Maintains history and ensures Helps maintain code history.
reversibility of changes.
Example: Current mobile operating systems (e.g., Android and
iOS) rely on version control systems like GIT for tracking
updates, bug fixes, and feature releases.
GitHub
Cloud-based platform for hosting GIT repositories
Features:
Centralized code collaboration.
Public and private repository hosting.
Tools for issue tracking, pull requests, and project management.

Benefits:
Simplifies code sharing.
Enhances project visibility.
Supports open-source contributions.
Theroy Ends Here ......
How GIT and GitHub Work Together
Download Git First

https://git-scm.com/downloads
Download the git based on your software requirement
Download VS Code

https://code.visualstudio.com/download
Create your Account in GIThub

https://github.com/
Our Aim is to Create a Website and Host in github for public access

Head over to GitHub and create a new public repository named


username.github.io, where username is your username (or
organization name) on GitHub.
Configure Git

Open Git Bash:


Right-click and open Git Bash.
Set Username and Email:

Configure your Git identity:

git config --global user.name "Your Name"


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

Verify Configuration:

git config --list


Generate an SSH Key

ssh-keygen -t ed25519 -C "[email protected]"

If your system doesn't support ed25519, use

Press Enter to save the key in the default location (~/.ssh/id_ed25519 or ~/.ssh/id_rsa).

Set a passphrase (optional, but recommended).


Add the SSH Key to the SSH Agent

eval "$(ssh-agent -s)"

Add Your SSH Key:

ssh-add ~/.ssh/id_ed25519
Copy the Public Key

cat ~/.ssh/id_ed25519.pub
Add the Key to GitHub:

1. Log in to GitHub.
2. Go to Settings > SSH and GPG Keys > New SSH Key.
3. Paste the key into the "Key" field, add a title, and click Add SSH Key.

Test the SSH Connection

ssh -T [email protected]
Clone the repository

git clone https://github.com/username/username.github.io


Open VS code
Create file name index.html and add some random text
Save the file

Open Terminal from VS code


git add --all
git commit -m “intial commit”
git push orgin master
…and you're done!
Fire up a browser and go to https://username.github.io.
Thanks

You might also like