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
[Link]
Download the git based on your software requirement
Download VS Code
[Link]
Create your Account in GIThub
[Link]
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
[Link], 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 [Link] "Your Name"
git config --global [Link] "your-email@[Link]"
Verify Configuration:
git config --list
Generate an SSH Key
ssh-keygen -t ed25519 -C "your-email@[Link]"
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 git@[Link]
Clone the repository
git clone [Link]
Open VS code
Create file name [Link] 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 [Link]
Thanks