Skip to content

Workflow

Sebastian Bayerl edited this page Sep 20, 2018 · 1 revision

Workflow

The general workflow follows the three branch principle. It is designed to limit the number of rebases and merge conflicts that will inevitably arise working in a bigger team. There are three kindes of branches in this workflow

  1. master branch

    No acutal work is done on the master branch. That means no pushing an doing work directly on the master branch. In regular intervals a working development branch will be merged to the master branch so there is always a stable version on the master branch for deployment to users. It is only for releases.

  2. development branch

    There will be (almost) no direct work on the development branch. It holds the latest stable version of the application. Only changes that won't break the build should be merged into the development branch. Merges should follow the 4-eye principle. Code will be accepted to the development branch after a simple code review done during a merge request. A continous delivery tool will automatically build and test the app and deploy it to some

  3. feature branches

    Feature branches will be where most of the work will be done. For every feature or change to be developed a new feature branch, based on the latest development branch will be created. All work and changes will be done on these branches. As soon as a feature it will be pushed to the remote repository. To merge the changes to the development branch a merge request should be created via the github-ui.

Example Workflow creating a new feature branch

  1. Clone repository

    git clone git@github.com:jcvasquezc/SMA2.git

  2. Switch to the development branch

    git checkout development

  3. Create a feature branch

    git branch feature/[some resonably explanatory name]

  4. Switch to feature branch

    git checkout feature/myfeature

  5. Commit changes and push changes to remote feature branch

    5.1 Add changes to commit

    Add all changes (including hidden files):

    git add .

    Add all changes (excluding hidden files):

    git add *

    Selectively add changes

    git add filename1 filename2

    5.2 Commit

    Remember, changes should be atomic, so you can retrace what you have done

    git commmit -m "description of what you have done"

  6. Push to remote

    The first time you do this there will probablye be no remote branch yet, so you need to set the upstream branch first. Just use the push command for this and the cli will tell you what command to use to create the remote.

    git push

    Example output if branch does not exist on remote, just copy and paste the code.

Visual representation

Merging branches back to development:

  1. Pull request(merge request)

Go to the github repository with your browser and navigate to your feature branch. Click on create new pull request next to your feature branch. Make sure to create the pull request to the correct base branch(should be development) and leave an explanatory comment.

  1. Review and accept merge In the github repo page navigate to Pull requests. If you see there is an open pull request click on it to review.
  1. Merge pull request After reviewing it and checking everything is ok, click on merge pull request. Confirm it and after successfully merging and closing it you can savely delete the branch.

Clone this wiki locally