Your Linux system is now connected to GitHub securely! 🔐
✅ Test Your SSH Connection
1
Test Connection (All Operating Systems)
Type this command in your terminal:
ssh -T git@github.com
2
If You See "Hi [username]!"
Congratulations! Your SSH key is working perfectly. You can now use Git with GitHub securely! 🎉
3
If You See an Error
1. Make sure your public key is added to GitHub (double-check the copy-paste)
2. Check that the SSH agent is running
3. Try the commands again from step 5/6
SSH Setup Complete!
You now have secure SSH access to GitHub. No more typing passwords! 🚀🔐
⚡ Git Commands Reference
76
Total Commands
76
Showing
8
Categories
🔍
No Commands Found
🎓 Beginner's Guide to Git & GitHub
What is Git?
Git is a tool that tracks changes in your code. Think of it like a time machine for your project - you can save snapshots and go back anytime!
📝 Key Concepts
1
Repository (Repo)
A folder that contains all your project files and the entire history of changes. Think of it as your project's memory!
2
Commit
A snapshot of your code at a specific moment. When you make changes and want to save them, you 'commit' with a message explaining what changed.
3
Branch
A separate copy of your code where you can work independently. It's like having multiple versions so you can experiment safely!
4
Pull Request (PR)
A way to ask for your code changes to be reviewed and merged into the main branch. It's how teams collaborate and review code before it goes live!
5
GitHub Actions
Automated workflows that run when you push code or create a PR. Think of it as a robot that tests your code automatically!
🚀 Your First Project (Step-by-Step)
1
Create a Project on GitHub
• Go to github.com and sign up (free!)
• Click "New repository"
• Give it a name like "my-first-project"
• Click "Create repository"
You've successfully created your first Git project and pushed it to GitHub! You're now a Git user! 🚀
🔀 How to Create a Pull Request (PR)
What is a Pull Request?
A PR is a way to propose changes to a project. You work on a branch, then ask for your changes to be reviewed and merged into the main branch. It's how teams collaborate safely!
Step-by-Step: Creating Your First PR
1
Create a New Branch
First, create a branch for your feature:
git checkout -b fix/typo-in-readme
Branch naming: Use prefixes like "fix/", "feature/", or "docs/"
2
Make Your Changes
Edit your files, add new features, or fix bugs. For example, edit README.md:
Good commit message: Be specific about what you changed
5
Push Your Branch to GitHub
Upload your branch to GitHub:
git push -u origin fix/typo-in-readme
6
Go to GitHub and Create PR
1. Go to your repository on GitHub
2. You'll see a yellow banner suggesting "Compare & pull request"
3. Click that button
4. Fill in the PR title and description
5. Click "Create pull request"
Good PR description includes: What you changed and why
7
Wait for Review
Your code is now in a PR! Others can review it, leave comments, and suggest changes before it's merged.
8
Merge Your PR
Once approved, click "Merge pull request" on GitHub to merge your changes into main!
PR Created! 🎉
You've successfully created and merged your first pull request! This is how professional teams work together!
💡 PR Best Practices
1
Keep PRs Small
Small PRs are easier to review. Don't try to change everything at once!
2
Write Clear Descriptions
Explain why you're making changes, not just what you changed
3
Respond to Feedback
If reviewers suggest changes, make them! That's how you learn and improve.
⚙️ GitHub Actions - Automate Your Workflow
What are GitHub Actions?
GitHub Actions are automated robots that run tasks when you push code or create a PR. They can test your code, run checks, deploy to servers, and much more - all automatically!
🤖 Common GitHub Actions Uses
1
Testing Code
Automatically run tests every time you push code to make sure nothing breaks.
Example: "Run all tests and report if any fail"
2
Code Quality Checks
Check code for style issues, security problems, and best practices.
Example: "Check if code follows style guidelines"
3
Automatic Deployment
Deploy your code to a server automatically when you merge to main.
Example: "Deploy website to hosting when main branch updates"
4
Build Artifacts
Automatically build and package your application.
Example: "Build Docker container for every push"
🚀 Create Your First GitHub Action
1
Create Workflow File
In your repository, create a file at this path:
.github/workflows/test.yml
GitHub automatically runs .yml files in the .github/workflows/ folder
2
Add Basic Workflow Code
Copy this simple workflow that runs on every push:
name: My First Action
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Say Hello
run: echo "Hello from GitHub Actions!"
1. Go to your GitHub repository
2. Click "Actions" tab
3. You'll see your workflow running!
4. Click on it to see the output and logs
Your First Action! 🤖
You've created your first GitHub Action! Now it's automated and runs every time you push code!
📝 Real-World Example: Testing JavaScript Code
📝
Automated Testing Workflow
This workflow automatically runs tests every time you push:
name: Run Tests
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '16'
- run: npm install
- run: npm test
This runs npm test every time code is pushed. If tests fail, GitHub will show a red X on your commit!
💡 GitHub Actions Benefits
✓
Always Fresh Checks
Your code is tested automatically. No need to remember to run tests!
✓
Catch Bugs Early
Find issues before they reach production. GitHub shows test results on PRs!
✓
Save Time
Automate repetitive tasks. Deploy, test, and build without manual work!
✓
Professional Workflow
GitHub Actions is how professional teams ensure code quality!
🌳 Visual Guide: How Git Actually Works
main branchfeature branch⬤ commit▲ branch pointer🎯 HEAD📄 file📦 staging
❓ Why Do We Need Version Control?
• No more final_v2_FINAL.py — every change is a tracked snapshot, not a guess
• Undo mistakes safely by reverting to any earlier snapshot
• Multiple people can work on the same project without overwriting each other
• See exactly what changed, when, and who changed it
📝 How Version Control Works
📁
Files on Disk
↓
📝
Working Directory
📄 app.py Clean
↓git add
📦
Staging Area (.git/index)
📄 app.py Empty
↓git commit
🗂
Local Repository (.git)
Previous commits only
↓git push
☁️
Remote Repository (GitHub)
Not pushed yet
Step 1 / 6
💡 Key Idea
Git records snapshots. Files move from Working Directory → Staging Area → Repository — and committing never deletes your working copy, it just saves a snapshot.
🌳 How Git Branching Works
Step 1 / 7
Note: This example creates a merge commit because both branches changed. If only feature had new commits, Git could perform a Fast-Forward merge instead — just moving the main pointer forward, no merge commit needed.
⚠️ What if there's a conflict?
main commit F changes app.py line 10, and feature commit E also changes app.py line 10.
⚠️ Conflict! Both branches modified the same part of the file, so Git needs your help deciding which change to keep.
💡 Key Idea
Branches are lightweight pointers to commits — not copies of your files. Merging combines two lines of history back together.