Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
211 changes: 211 additions & 0 deletions CHEAT_SHEET.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,211 @@
# GitHub Quick Reference Cheat Sheet

A handy reference guide for common GitHub operations and commands.

## 🌐 GitHub Web Interface

### Creating a New Repository
1. Click the **+** icon in the top right corner
2. Select **New repository**
3. Fill in repository name and description
4. Choose public or private
5. Click **Create repository**

### Creating a Branch
1. Click the branch dropdown (shows "main" by default)
2. Type your new branch name
3. Click **Create branch**

### Making Changes Through Web Interface
1. Navigate to the file you want to edit
2. Click the pencil icon (✏️) to edit
3. Make your changes
4. Scroll down to the commit section
5. Add a commit message
6. Click **Commit changes**

### Opening a Pull Request
1. Click **Pull requests** tab
2. Click **New pull request**
3. Select the branch with your changes
4. Click **Create pull request**
5. Add a title and description
6. Click **Create pull request**

### Merging a Pull Request
1. Open the pull request
2. Review the changes
3. Click **Merge pull request**
4. Click **Confirm merge**
5. Optionally delete the branch

## 💻 Git Command Line Basics

### Setup and Configuration
```bash
# Set your name
git config --global user.name "Your Name"

# Set your email
git config --global user.email "your.email@example.com"

# Check your settings
git config --list
```

### Starting a Repository
```bash
# Initialize a new repository
git init

# Clone an existing repository
git clone https://github.com/username/repository.git
```

### Basic Workflow
```bash
# Check status of your files
git status

# Add files to staging area
git add filename.txt # Add specific file
git add . # Add all changed files

# Commit your changes
git commit -m "Your commit message"

# Push changes to GitHub
git push origin main
```

### Branching
```bash
# Create a new branch
git branch branch-name

# Switch to a branch
git checkout branch-name

# Create and switch to new branch (shortcut)
git checkout -b branch-name

# List all branches
git branch

# Delete a branch
git branch -d branch-name
```

### Updating and Syncing
```bash
# Get latest changes from GitHub
git pull origin main

# Fetch changes without merging
git fetch origin

# Merge a branch into current branch
git merge branch-name
```

### Viewing History
```bash
# View commit history
git log

# View compact history
git log --oneline

# View changes in files
git diff

# View changes for a specific file
git diff filename.txt
```

## 🔑 Key Concepts

### The Git Workflow
1. **Modify** files in your working directory
2. **Stage** changes you want to commit (`git add`)
3. **Commit** staged changes (`git commit`)
4. **Push** commits to GitHub (`git push`)

### Branch Strategy
- **main/master**: The stable, production-ready code
- **feature branches**: Create these for new features or changes
- **Always branch**: Never work directly on main for new changes

### Commit Message Best Practices
- Use present tense ("Add feature" not "Added feature")
- Keep first line under 50 characters
- Be descriptive but concise
- Example: "Fix login button alignment on mobile"

## 📝 Common Terms

| Term | Description |
|------|-------------|
| **Repository** | A project folder tracked by Git |
| **Clone** | Download a copy of a repository |
| **Fork** | Create your own copy of someone else's repository |
| **Commit** | Save a snapshot of your changes |
| **Push** | Upload your commits to GitHub |
| **Pull** | Download and merge changes from GitHub |
| **Branch** | A separate line of development |
| **Merge** | Combine changes from different branches |
| **Pull Request** | Propose changes to be merged |
| **Remote** | A version of your repository hosted elsewhere (like GitHub) |
| **Origin** | The default name for your remote repository |

## 🆘 Common Issues and Solutions

### Problem: Changes not showing on GitHub
**Solution**: Make sure you've committed AND pushed your changes
```bash
git add .
git commit -m "Your message"
git push origin main
```

### Problem: Merge conflict
**Solution**:
1. Open the conflicting files
2. Look for conflict markers (`<<<<<<<`, `=======`, `>>>>>>>`)
3. Edit to keep the correct version
4. Remove the conflict markers
5. Commit the resolved files

### Problem: Want to undo last commit (not pushed yet)
**Solution**:
```bash
git reset HEAD~1 # Keeps changes but undoes commit
```

### Problem: Accidentally committed to wrong branch
**Solution**:
```bash
git stash # Save your changes
git checkout correct-branch
git stash pop # Apply your changes
```

## 🎯 Tips for Success

1. **Commit often**: Small, frequent commits are better than large ones
2. **Write good commit messages**: Your future self will thank you
3. **Pull before you push**: Always get the latest changes first
4. **Branch for features**: Keep your main branch clean
5. **Review before committing**: Use `git status` and `git diff`
6. **Use .gitignore**: Don't commit unnecessary files

## 📚 Learn More

- [GitHub Documentation](https://docs.github.com)
- [Pro Git Book](https://git-scm.com/book/en/v2) - Free and comprehensive
- [GitHub Learning Lab](https://lab.github.com)
- [Git Cheat Sheet (PDF)](https://education.github.com/git-cheat-sheet-education.pdf)

---

**Remember**: Practice makes perfect! The more you use Git and GitHub, the more natural it becomes. 🚀
85 changes: 85 additions & 0 deletions GETTING_STARTED.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# Getting Started with GitHub

Welcome! This guide will help you understand the basics of GitHub and get you started on your learning journey.

## What is GitHub?

GitHub is a web-based platform where developers store, share, and collaborate on code. Think of it as a social network for programmers, where you can:
- Store your code projects
- Track changes to your code over time
- Collaborate with others
- Share your work with the world

## Key Concepts for Beginners

### 1. **Repository (Repo)**
A repository is like a folder for your project. It contains all your project files and the history of changes made to them.

### 2. **Git**
Git is the version control system that powers GitHub. It helps you track changes to your files over time.

### 3. **Commit**
A commit is like a snapshot of your project at a specific point in time. Think of it as saving your progress in a video game.

### 4. **Branch**
A branch is a separate version of your repository. You can make changes on a branch without affecting the main version of your project.

### 5. **Pull Request (PR)**
A pull request is how you propose changes to a project. It's like saying "Hey, I made some improvements. Would you like to include them?"

### 6. **Merge**
Merging is when you combine changes from one branch into another, usually from your working branch into the main branch.

## Your First Steps on GitHub

If you're new to GitHub, here's what you should do:

1. **Create a GitHub Account**: Go to [github.com](https://github.com) and sign up
2. **Complete This Course**: This repository is an interactive course that will teach you the basics
3. **Follow the README**: The main README.md file has step-by-step instructions
4. **Practice**: The best way to learn is by doing!

## How This Course Works

This repository uses GitHub Actions to automatically guide you through the learning process:

1. You'll start by creating a branch
2. Then you'll make a commit
3. Next, you'll open a pull request
4. Finally, you'll merge your changes

Each step builds on the previous one, and the repository will automatically update with new instructions as you progress.

## Common GitHub Terms

| Term | Definition |
|------|------------|
| **Fork** | Creating your own copy of someone else's repository |
| **Clone** | Downloading a repository to your computer |
| **Push** | Sending your changes to GitHub |
| **Pull** | Getting the latest changes from GitHub |
| **Main/Master** | The primary branch of a repository |
| **README** | A file that explains what your project is about |

## Tips for Success

✅ **Read carefully**: Each step has detailed instructions
✅ **Take your time**: There's no rush - learn at your own pace
✅ **Ask questions**: If you're stuck, check GitHub's documentation or community forums
✅ **Practice regularly**: The more you use GitHub, the more comfortable you'll become
✅ **Don't be afraid to experiment**: You can't really break anything in your own repositories

## Helpful Resources

- [GitHub Docs](https://docs.github.com): Official GitHub documentation
- [Git Handbook](https://guides.github.com/introduction/git-handbook/): Introduction to Git
- [GitHub Learning Lab](https://lab.github.com): More interactive courses
- [GitHub Community](https://github.community): Ask questions and get help

## Ready to Start?

Head back to the main [README.md](README.md) file to begin your GitHub learning journey!

---

**Remember**: Everyone was a beginner once. Take it one step at a time, and you'll be comfortable with GitHub in no time! 🚀
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@

_Get started using GitHub in less than an hour._

## 📖 Quick Navigation

**New to GitHub?** Start here:
- 📘 [Getting Started Guide](GETTING_STARTED.md) - Learn the basics and key concepts
- 📋 [Quick Reference Cheat Sheet](CHEAT_SHEET.md) - Handy commands and operations
- 🔧 [Troubleshooting Guide](TROUBLESHOOTING.md) - Solutions to common problems

**Ready to learn?** Follow the course below!

</header>

<!--
Expand All @@ -29,6 +38,10 @@ People use GitHub to build some of the most advanced technologies in the world.
- **Prerequisites**: None. This course is a great introduction for your first day on GitHub.
- **How long**: This course takes less than one hour to complete.

### 🆕 New to GitHub?

If this is your first time using GitHub, we recommend starting with our [Getting Started Guide](GETTING_STARTED.md) to familiarize yourself with key concepts before beginning the course.

In this course, you will:

1. Create a branch
Expand Down Expand Up @@ -58,6 +71,15 @@ In this course, you will:
- Scroll down and click the **Create repository** button at the bottom of the form.
3. After your new repository is created, wait about 20 seconds, then refresh the page. Follow the step-by-step instructions in the new repository's README.

## 📚 Additional Learning Resources

Once you complete this course, continue your GitHub journey with these resources:

- **[Getting Started Guide](GETTING_STARTED.md)**: Quick reference for GitHub concepts and terminology
- **[GitHub Docs](https://docs.github.com)**: Official documentation for all GitHub features
- **[Git Handbook](https://guides.github.com/introduction/git-handbook/)**: Learn the fundamentals of Git
- **[GitHub Skills](https://skills.github.com)**: More interactive courses to expand your knowledge

<footer>

<!--
Expand Down
Loading