GitHub Flow

GitHub flowopen in new window is workflow that is considered standard practice when collaborating on GitHub.

Before you begin with GitHub flow, create a repository on GitHub and add any collaborators. Then clone the repository to your computer.

Create a New Branch

The principle rule of GitHub flow is that the default branch is ALWAYS deployable. This means work should rarely be done directly on the default branch. Instead, for each new feature, change, or experiment, a branch should be created. This provides the freedom of making changes without affecting the default branch.

If you need a refresher on create Git branches, refer to Branching with Git.

Make Changes

Once on a new branch, it is safe to make changes with without affecting the default branch. The changes will not end up on the default branch until it is merge. This means that mistakes can be made without the fear of it breaking the entire project.

Commit to the new branch often. Give each commit a descriptive message show it is easier to know what changes the commit contains. Commits should also be pushed to the remote repository. Not only will this make the new branch accessible from any device, it also allows other collaborators to review the work.

When the work on the new branch is completed and all changes have been pushed to GitHub it is time to create a pull request.

Create a Pull Request

This YouTube video was created by GitHub Training & Guides.

Pull requests are a way to ask collaborators for feedback on your changes, and the pull request review is a vital part of the GitHub flow.

Creating a pull requestopen in new window can be done directly from github.com. Navigate to the project's remote repository and select the branch containing your commits. Then click on the "Pull request" button found above the list of files.

When creating a pull request, it is important to include a summary of the changes and what problems were solved. Once the pull request is submitted, GitHub will

After a GitHub repository has been created and cloned