Skip to content

Welcome to the GitHub for Beginners practice repository! This repo is designed to help you learn and practice essential GitHub workflows including forking, cloning, branching, committing, pushing, and creating pull requests.

License

Notifications You must be signed in to change notification settings

nisalgunawardhana/Github-for-beginners

Repository files navigation

πŸš€ GitHub 101 - GitHub For Beginners

Welcome to the GitHub for Beginners practice repository! This repo is designed to help you learn and practice essential GitHub workflows including forking, cloning, branching, committing, pushing, and creating pull requests.

GitHub for Beginners banner

Follow me on GitHub Star this repo

πŸ“‹ What You'll Learn

  • βœ… Fork a repository
  • βœ… Clone a repository to your local machine
  • βœ… Create and switch between branches
  • βœ… Make changes to files
  • βœ… Stage and commit changes
  • βœ… Push changes to GitHub
  • βœ… Create Pull Requests
  • βœ… Work with Issues
  • βœ… Basic Git commands and GitHub workflow

Prerequisites

Before you begin, make sure you have the following installed. For detailed installation instructions, see Prerequisites – GitHub 101 (For Beginners).pdf

1. Install Git

For Windows:

  1. Download Git from git-scm.com
  2. Run the installer and follow the setup wizard
  3. Use the default settings (recommended for beginners)
  4. Verify installation by opening Command Prompt or PowerShell:
    git --version

For Mac:

  1. Install via Homebrew (recommended):
    brew install git
    Or download from git-scm.com
  2. Verify installation in Terminal:
    git --version

2. Install Visual Studio Code

  1. Download VS Code from code.visualstudio.com
  2. Install the application for your operating system
  3. Install the VS Code command line tool to open projects from terminal

Instruction Videos

Language Video Status
Sinhala Watch Tutorial βœ… Available
English Watch Tutorial βœ… Available

Getting Started

Step 1: Fork This Repository

  1. Click the "Fork" button at the top right of this repository
  2. This creates a copy of the repository in your GitHub account For detailed steps, see How to Fork a Repository

Step 2: Clone Your Fork

# Replace 'your-username' with your actual GitHub username
git clone https://github.com/your-username/Github-for-beginners.git

# Navigate to the project directory
cd Github-for-beginners

πŸ’‘ Tip: To open the project in VS Code from your terminal, run:

code .

Make sure you have the VS Code command line tool installed.

Branch Practice Exercises

Exercise 1: Create Your First Branch

# Create and switch to a new branch with your name
git checkout -b feature/your-name-introduction

# Or alternatively
git branch feature/your-name-introduction
git checkout feature/your-name-introduction

Exercise 2: Make Your First Changes

  1. Open the student-introductions.md file
  2. Add your introduction following the template
  3. Save the file

Exercise 3: Stage and Commit Changes

# Check what files have changed
git status

# Add your changes to staging
git add student-introductions.md

# Or add all changes
git add .

# Commit your changes with a descriptive message
git commit -m "Add introduction for [Your Name]"

⚠️ Note: If you encounter issues like Git not recognizing your name or email during commits, this can prevent you from committing changes.
You can troubleshoot and fix it by following the steps in the support file:
Git-Configuration-Troubleshooting.md

Exercise 4: Push Your Branch

# Push your branch to your fork
git push origin feature/your-name-introduction

Exercise 5: Create a Pull Request

  1. Go to your fork on GitHub
  2. You'll see a prompt to create a Pull Request
  3. Click "Compare & pull request"
  4. Add a title and description
  5. Click "Create pull request"

GitHub for Beginners banner

GitHub for Beginners banner

GitHub for Beginners banner

πŸ† Submission Guidelines

When you complete the exercises:

  1. Move to the main repository (original one) by switching your remote to the upstream/main repo if needed.
  2. Create an issue on that branch using the "Submission" template.
  3. Include the following information:
    • Your GitHub username
    • Links to your pull requests
    • Screenshot of your contribution
    • Brief reflection on what you learned

GitHub for Beginners banner

GitHub for Beginners banner

πŸ“‹ Checklist for Completion

  • Successfully forked the repository
  • Cloned to local machine
  • Created at least 2 different branches
  • Made commits with good commit messages
  • Pushed branches to GitHub
  • Created at least 1 pull request
  • Created at least 1 issue on the main repository
  • Added your introduction to the student introductions file

πŸ› Working with Issues

Creating an Issue

  1. Go to the Issues tab
  2. Click "New issue"
  3. Choose from our templates:
    • Bug Report
    • Feature Request
    • Question
    • Submission

Issue Best Practices

  • Use descriptive titles
  • Provide detailed descriptions
  • Add relevant labels
  • Reference related issues or PRs using #number

πŸ”„ Common Git Commands Reference

Basic Commands

# Check repository status
git status

# View commit history
git log --oneline

# Check current branch
git branch

# Switch branches
git checkout branch-name

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

# Delete a branch
git branch -d branch-name

Working with Changes

# Add specific files
git add filename.txt

# Add all changes
git add .

# Commit with message
git commit -m "Your commit message"

# Add and commit in one step
git commit -am "Your commit message"

Synchronizing with Remote

# Push changes
git push origin branch-name

# Pull latest changes
git pull origin main

# Fetch updates without merging
git fetch upstream

🀝 Contributing

This is a learning repository, and contributions are welcome! If you have suggestions for improvement:

  1. Create an issue to discuss your idea
  2. Fork the repository
  3. Create a feature branch
  4. Make your changes
  5. Submit a pull request

πŸ“š Additional Resources

πŸ“ž Need Help?

  • Create an issue with the "Question" template
  • Check existing issues for similar questions
  • Review the documentation links above

βš–οΈ License

This project is licensed under the MIT License - see the LICENSE file for details.


🌐 Connect with Me

Follow me on social media for updates and more learning resources:

Twitter LinkedIn Instagram

Happy Learning! πŸŽ‰

Remember: Making mistakes is part of learning. Don't be afraid to experiment and try new things!

About

Welcome to the GitHub for Beginners practice repository! This repo is designed to help you learn and practice essential GitHub workflows including forking, cloning, branching, committing, pushing, and creating pull requests.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published