Skip to content

sreelekshmisl/github_basics

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

GitHub Basics Repository

This repository is a hands-on sandbox for anyone learning how to use Git and GitHub. Whether you're just starting out or need structured practice, this will walk you through everything from cloning to making pull requests. The goal: make you comfortable with version control and collaborating on open-source platforms.


What You'll Learn

  • Basic Git commands
  • Setting up Git
  • Forking and cloning repositories
  • Working with branches
  • Committing and pushing changes
  • Creating pull requests
  • Resolving merge conflicts
  • Collaborating with others

🔧 Setup Instructions

1. Install Git

Check if Git is already installed:

git --version

If not, download from https://git-scm.com/downloads

2. Configure Git

git config --global user.name "Your Name"
git config --global user.email "[email protected]"

Workflow Summary for our exercise

FORK → CLONE → BRANCH → COMMIT → PUSH → PULL REQUEST → MERGE

🛠️ Step-by-Step Instructions

Fork the Repository

Forking creates a personal copy of someone else’s repository on your GitHub account. It lets you freely experiment with changes without affecting the original project

How to fork a repo

  1. Go to the repo page on GitHub
  2. Click the Fork button on the top-right Fork
  3. Now edit the name to suit you and click on create fork Create Fork

How to clone a repository

  1. Go to the repo page on github
  2. Click on the green Code button and then copy the link Code
  3. Now open your terminal run this command
git clone your-repo-link
cd github-basics # to enter the repo

Create a Branch (Not Needed for this exercise)

A branch is a separate line of development. It allows you to work on features or fixes without touching the main codebase until you’re ready

How to create a branch

git checkout -b your-branch-name

Add your name to the CONTRIBUTORS.md

Open this file in your preferred code editor and add your name to CONTRIBUTORS.md


Stage and Commit

git add .
git commit -m "add: <name> to CONTRIBUTORS.md"

Use clear commit messages.


Push to Your Fork

git push origin your-branch-name

Open a Pull Request (PR)

  1. Go to your forked repo on GitHub
  2. Click Compare & pull request
  3. Add a title and description
  4. Submit the PR to the original repo

To push updates to your fork:

git push origin main

🔀 Resolving Merge Conflicts

If there's a conflict: HOW DO I EXPLAIN THIS


🧹 Best Practices

  • Commit often, with clear messages
  • Keep your branches focused on one task
  • Never commit secrets (e.g. passwords, API keys)
  • Pull before pushing
  • Review your code before submitting PRs

A Couple Useful things

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published