Skip to content

Instantly share code, notes, and snippets.

@rasheedamir
Last active August 29, 2015 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rasheedamir/19593f7a520fd0f31987 to your computer and use it in GitHub Desktop.
Save rasheedamir/19593f7a520fd0f31987 to your computer and use it in GitHub Desktop.
Git

Workflow

Git Workflow

Pull Requests

Aside from isolating feature development, branches make it possible to discuss changes via pull requests. Once someone completes a feature, they don’t immediately merge it into upstream branch (i.e. develop/master). Instead, they push the feature branch to the central server and file a pull request asking to merge their additions into upstream (i.e. develop/master). This gives other developers an opportunity to review the changes before they become a part of the main codebase.

Code review is a major benefit of pull requests, but they’re actually designed to be a generic way to talk about code. You can think of pull requests as a discussion dedicated to a particular branch. This means that they can also be used much earlier in the development process. For example, if a developer needs help with a particular feature, all they have to do is file a pull request. Interested parties will be notified automatically, and they’ll be able to see the question right next to the relevant commits.

Once a pull request is accepted, the actual act of publishing a feature is much the same as in the Centralized Workflow. First, you need to make sure your local develop/master is synchronized with the upstream develop/master. Then, you merge the feature branch into develop/master and push the updated develop/master back to the central repository.

Pull Request Example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment