GitHub is a web-based platform for hosting Git repositories and collaborating on software projects. It provides features that help developers store code, work with other developers, review changes, manage issues, and automate development workflows.
GitHub is a platform where developers can host Git repositories and collaborate on software projects.
A GitHub repository can contain source code, documentation, configuration files, and other project files.
| Git | GitHub |
|---|---|
| Version control system | Development and collaboration platform |
| Runs locally | Provides online repository hosting |
| Tracks project history | Provides collaboration tools |
| Uses commands such as commit and branch | Provides features such as pull requests and issues |
A GitHub repository is a project space that stores files and Git history.
For example:
my-website
├── index.html
├── style.css
├── script.js
└── README.md
GitHub provides many features for software development and collaboration.
A GitHub repository can be used as a remote repository for a local Git project.
Local Repository
↕
Git Remote
↕
GitHub Repository
Commands such as git push and git pull can
be used to synchronize changes.
A GitHub account provides access to GitHub's platform features. After signing in, users can create repositories, manage projects, participate in collaboration, and configure their profiles.
A GitHub profile represents a user's activity and public presence on the platform.
Depending on the user's settings and activity, a profile can contain repositories, contributions, profile information, and other public activity.
GitHub repositories can have different visibility settings.
Repository visibility should be selected according to the project's requirements.
A repository can be created on GitHub for a new or existing project.
A repository normally has a name and can include optional project information such as a description and README file.
After creating a repository on GitHub, you can connect a local Git repository to it.
git remote add origin https://github.com/user/project.git
The remote can then be verified with:
git remote -v
After committing changes locally, you can push them to GitHub.
git push -u origin main
This sends the local main branch to the
origin remote.
You can retrieve and integrate changes from a GitHub repository using
git pull.
git pull origin main
This is useful when changes have been made to the remote repository.
The git clone command creates a local copy of a GitHub
repository.
git clone https://github.com/user/project.git
The cloned repository includes its Git history and remote configuration.
GitHub Issues can be used to track tasks, bugs, feature requests, questions, and other project work.
For example:
Issue #25
Fix login validation
A pull request is a way to propose changes from one branch or repository to another and discuss those changes before integration.
Pull requests are commonly used for code review and collaboration.
GitHub provides tools for reviewing proposed code changes. Team members can inspect changed files, leave comments, and discuss modifications through pull requests.
Branches allow developers to work on different lines of development.
main
feature-login
bugfix-payment
Developers can create branches locally and push them to GitHub.
A fork is a copy of a repository under another user's or organization's account.
Forks are commonly used when someone wants to work on a project without directly modifying the original repository.
Repository owners can provide other users with access to collaborate on a repository according to the repository's configured permissions.
Collaborators can work together on issues, branches, pull requests, and repository files according to their access level.
A README.md file provides information about a project.
It is commonly written using Markdown.
A README may contain:
GitHub provides release features that can organize published versions of a project around Git tags.
For example, a project may have a release associated with:
v1.0.0
GitHub Actions provides automation capabilities for repositories. Workflows can be used to automate tasks such as testing, building, and deployment.
Code Push
↓
Workflow
↓
Test
↓
Build
↓
Deploy
GitHub Projects provides tools for organizing and tracking project work.
Teams can use project views and work items to organize tasks and monitor progress.
GitHub Discussions provides a space for conversations around a repository or community.
It can be used for questions, announcements, ideas, and general project discussions where enabled.
GitHub Pages can be used to publish websites from GitHub repositories.
It is commonly used for documentation, project pages, portfolios, and static websites.
GitHub provides security-related features that can help developers identify and manage security issues in repositories.
Developers should also avoid committing passwords, API keys, private keys, or other sensitive credentials to repositories.
Create Repository
↓
Clone / Connect Repository
↓
Create Branch
↓
Make Changes
↓
Commit Changes
↓
Push Branch
↓
Create Pull Request
↓
Review Changes
↓
Merge
This is a common collaboration workflow on GitHub.
git clone URL
git remote -v
git status
git add .
git commit -m "Message"
git push origin main
git pull origin main
git fetch origin
These are Git commands commonly used when working with GitHub repositories.
git clone https://github.com/user/my-project.git
cd my-project
git switch -c feature-login
# Make changes
git add .
git commit -m "Add login page"
git push -u origin feature-login
After pushing the branch, a pull request can be created on GitHub for review and integration.
GitHub is a platform for hosting Git repositories and collaborating on software projects.
GitHub works with Git and provides additional tools such as repositories, branches, pull requests, issues, code review, collaborators, projects, releases, Actions, and Pages.
Git → Version Control
GitHub → Hosting + Collaboration Platform
git clone downloads a repository to your computer.git push sends local commits to a remote repository.git pull retrieves and integrates remote changes.Question: What is GitHub primarily used for?