Tutorial: Github basic
Last updated
Last updated
Repository:
A repository is usually used to organize a single project. Repositories can contain folders and files, images, videos, spreadsheets, and data sets – anything your project needs
Branch:
The way to work on different versions of a repository at one time. By default your repository has one branch named main
which is considered to be the definitive branch. We use branches to experiment and make edits before committing them to main
.
This diagram shows:
The main
branch
A new branch called feature
(because we’re doing ‘feature work’ on this branch)
The journey that feature
takes before it’s merged into main
Have you ever saved different versions of a file? Something like:
story.txt
story-joe-edit.txt
story-joe-edit-reviewed.txt
Branches accomplish similar goals in GitHub repositories.
Commit:
It tells Git that you made some changes which you want to record.
Pull:
When you open a pull request, you’re proposing your changes and requesting that someone review and pull in your contribution and merge them into their branch
The GitHub flow is a lightweight, branch-based workflow built around core Git commands used by teams around the globe—including ours.
The GitHub flow has six steps, each with distinct benefits when implemented:
Create a branch: Topic branches created from the canonical deployment branch (usually main
) allow teams to contribute to many parallel efforts. Short-lived topic branches, in particular, keep teams focused and results in quick ships.
Add commits: Snapshots of development efforts within a branch create safe, revertible points in the project’s history.
Open a pull request: Pull requests publicize a project’s ongoing efforts and set the tone for a transparent development process.
Discuss and review code: Teams participate in code reviews by commenting, testing, and reviewing open pull requests. Code review is at the core of an open and participatory culture.
Merge: Upon clicking merge, GitHub automatically performs the equivalent of a local ‘git merge’ operation. GitHub also keeps the entire branch development history on the merged pull request.
Deploy: Teams can choose the best release cycles or incorporate continuous integration tools and operate with the assurance that code on the deployment branch has gone through a robust workflow.
Learn more about the GitHub flow
Developers can find more information about the GitHub flow in the resources provided below.