Git Notes
A GitHub repository is the fundamental unit of work on GitHub — it is where your project lives, along with its entire history, branches, issues,...
A GitHub repository is the fundamental unit of work on GitHub — it is where your project lives, along with its entire history, branches, issues, documentation, and collaboration tools. Understanding how to create, configure, and manage repositories effectively is essential for every developer who uses GitHub, whether for personal projects or team-based development.
What Is a Repository
A repository (often called a "repo") is a storage space for your project. It contains all of your project's files and stores each file's revision history. Repositories can have multiple collaborators and can be either public (visible to everyone) or private (visible only to people you grant access).
On GitHub, a repository is more than just file storage — it includes:
- The full Git history (every commit ever made)
- Branches for parallel development
- Issues for tracking bugs and features
- Pull requests for code review
- GitHub Actions for automation
- Wiki for documentation
- Project boards for planning
- Release management
Creating a Repository
On GitHub
- Click the "+" icon in the top right → "New repository"
- Fill in the details:
- Name — Short, descriptive, lowercase with hyphens
- Description — One-sentence summary of the project
- Visibility — Public or Private
- Initialize with — README, .gitignore, license
From the Command Line
# Create locally first
mkdir my-project
cd my-project
git init
echo "# My Project" > README.md
git add .
git commit -m "Initial commit"
# Create on GitHub and push
gh repo create my-project --public --source=. --pushUsing GitHub CLI
gh repo create my-project --public --description "A web application" --cloneRepository Naming Conventions
Good repository names are:
- Lowercase with hyphens:
user-auth-service - Descriptive but concise:
react-todo-appnotmy-app - Consistent within an organization: prefix with team or project name
Avoid: spaces, uppercase, special characters, generic names like test or project1.
Repository Structure
A well-organized repository follows conventions:
The README File
Your README is the front door to your project. A good README includes:
# Project Name
Brief description of what this project does.
## Features
- Feature 1
- Feature 2
## Quick Start
### Prerequisites
- Node.js 18+
- PostgreSQL 15+
### Installation
git clone https://github.com/username/project.git
cd project
npm install
npm run dev
## Usage
Explain how to use the application with examples.
## Contributing
See CONTRIBUTING.md for guidelines.
## License
MIT License - see LICENSE file for details.Visibility: Public vs Private
Public repositories:
- Visible to everyone on the internet
- Anyone can clone and fork
- Free on all GitHub plans
- Good for open source, portfolios, learning projects
Private repositories:
- Only visible to you and invited collaborators
- Cannot be forked by outsiders
- Free on all plans (with collaborator limits on free tier)
- Used for proprietary code, client work, personal projects
Repository Settings
Important settings to configure:
Default branch: Set to main (Settings → Branches → Default branch)
Branch protection: Require reviews, passing CI, and up-to-date branches before merging
Collaborators: Add team members with appropriate permission levels (Read, Write, Admin)
Features toggle: Enable/disable Issues, Wiki, Projects, Discussions as needed
Cloning and Working with Repositories
# Clone via HTTPS
git clone https://github.com/username/repository.git
# Clone via SSH (requires SSH key setup)
git clone git@github.com:username/repository.git
# Clone a specific branch
git clone --branch develop https://github.com/username/repository.gitRepository Templates
Create template repositories to standardize new projects:
- Go to Settings → Check "Template repository"
- When creating new repositories, select "Repository template"
Templates are perfect for:
- Standardized project structures
- Pre-configured CI/CD workflows
- Consistent documentation templates
- Shared tooling configurations
Key Takeaways
GitHub repositories are the central hub for your code, documentation, collaboration, and automation. Create repositories with clear names and descriptions, organize files following conventions, write comprehensive READMEs, and configure settings (branch protection, visibility, collaborators) to match your project's needs. A well-maintained repository communicates professionalism and makes collaboration effortless for everyone involved.
Exam Focus
Revise definitions, diagrams, examples, and short-answer points for GitHub Repositories.
Interview Use
Prepare one clear explanation, one practical example, and one common mistake for this Git & GitHub topic.
Search Terms
git-github, git & github, git, github, fundamentals, repositories, github repositories
Related Git & GitHub Topics