Lesson 1: Getting Started with GitHub
This lesson covers the basics of creating a GitHub account, setting up a repository, and adding files.
Step 1: Creating a GitHub Account
- Go to github.com.
- Click "Sign up" in the top-right corner.
- Enter the required details:
- Username
- Password
- Verify your email.
- Complete the setup (optional steps can be skipped).
Step 2: Creating a New Repository
- Click the "+" button in the top-right corner and select "New repository".
- Fill in the repository details:
- Repository name (e.g.,
my-first-repo) - Description (optional)
- Choose Public or Private visibility
- Repository name (e.g.,
- (Optional) Select "Initialize this repository with a README".
- Click "Create repository".
Step 3: Adding Files to the Repository
Method 1: Upload via GitHub Web
- Open your repository.
- Click "Add file" → "Upload files".
- Drag and drop files or click "Choose your files".
- Add a commit message (e.g.,
"Added my first file"). - Click "Commit changes".
Method 2: Using Git (Command Line)
-
Install Git if it is not already installed.
-
Open a terminal and run the following commands:
git clone <repo-url>
cd <repo-name>
echo "Hello GitHub" > hello.txt
git add .
git commit -m "Added hello.txt"
git push origin main