Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions contribution-workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,14 @@

## Introduction

This document outlines the workflow and steps to go through when proposing new changes to the READMEs repository. The workflow should be followed when making changes to improve current READMEs as well as when adding new READMEs.
At first sight the process might seem complicated, but it is a great exercise to practice contribution to future programming projects and
ensures that all added changes are checked.
This document outlines the workflow and steps to go through when proposing new changes to the READMEs repository. The workflow should be followed when making changes to improve current READMEs as well as when adding new READMEs. At first sight the process might seem complicated, but it is a great exercise to practice contribution to future programming projects and ensures that all added changes are checked.

If you have any questions or are stuck somewhere please don't hesitate to ask in the README Gitter channel: [![Join the chat at https://gitter.im/codingforeveryone/READMEs](https://badges.gitter.im/codingforeveryone/READMEs.svg)](https://gitter.im/codingforeveryone/READMEs?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

##The Feature Branch Workflow

The process used is called [Feature Branch Workflow](https://www.atlassian.com/git/tutorials/comparing-workflows/feature-branch-workflow).
The basic concept of this workflow is that every change is treated as a new "feature" and made on a branch dedicated to that change.
Once the change is ready a [pull request](https://help.github.com/articles/using-pull-requests/) is raised. This pull request will be checked by another person and then merged into the master branch.
After merging the branch is deleted.
The process used is called [Feature Branch Workflow](https://www.atlassian.com/git/tutorials/comparing-workflows/feature-branch-workflow). The basic concept of this workflow is that every change is treated as a new "feature" and made on a branch dedicated to that change.
Once the change is ready a [pull request](https://help.github.com/articles/using-pull-requests/) is raised. This pull request will be checked by another person and then merged into the master branch. After merging the branch is deleted.

The following picture visualizes the process of creating and merging a new branch for each feature or change:

Expand All @@ -23,8 +19,7 @@ While you could do all your editing and branch creation using the GitHib online

##Setting up a local repository

Before working with the READMEs repository we should install git and clone the repository to our local directory. Refer to [Git Basics]((http://codingforeveryone.foundersandcoders.org/programmer-skills/git-basics.html#installing-git-on-mac)) for instructions on how to install Git (and glance over the [cheat sheet](http://codingforeveryone.foundersandcoders.org/programmer-skills/git-basics.html#cheat-sheet) while you're there).
Be aware that most beginners' guides to setting up Git out on the web assume that you will be making contributions via a fork. **In this workflow though we don't use forks (remote copies of the repository) but simply branches.**
Before working with the READMEs repository we should install Git and clone the repository to our local directory. Refer to [Git Basics](http://codingforeveryone.foundersandcoders.org/programmer-skills/git-basics.html#installing-git-on-mac) for instructions on how to install Git (and glance over the [cheat sheet](http://codingforeveryone.foundersandcoders.org/programmer-skills/git-basics.html#cheat-sheet) while you're there). Be aware that most beginners' guides to setting up Git out on the web assume that you will be making contributions via a fork. **In this workflow, though, we don't use forks (remote copies of the repository), but simply branches.**

Setting up Git without a fork is simpler. All you need to do is clone the remote repository:

Expand Down Expand Up @@ -64,13 +59,19 @@ To create a new branch and switch to the branch at the same time, you can use th
$ git checkout -b <name of the branch>
```

This is equalivalent to first creating the branch and then switching to it with the following two commands:
This is equivalent to first creating the branch and then switching to it with the following two commands:

```bash
$ git branch <name of the branch>
$ git checkout <name of the branch>
```

Note that if you have already checked out a branch and comitted changes, you should `checkout master` before creating your branch, or it will be created from the branch you have currently checked out. Alternatively, specify explicitly that the new branch should be created from master:

```bash
$ git checkout -b <name of the branch> master
```

After creating and switching to the branch locally you should push the branch to GitHub and set it as the default upstream branch:

```bash
Expand Down Expand Up @@ -161,7 +162,7 @@ Here we will differentiate between different **types of changes** indicated by t

**For smaller changes** such as pure corrections of typos (_type: correct_) anyone can check and merge the pull request.

After merging the pull request the branch is not needed any more and should be deleted by the person who merged it. This can be done directly in the pull request view or in the terminal with the following command.
After merging the pull request the branch is not needed any more and should be deleted from the GitHub repository by the person who merged it. Additionally, to delete the branch from your local repository, execute the following terminal command:

```bash
git branch -D <name of the branch>
Expand Down