Skip to content

Git Workflow

Hrishi edited this page Jun 19, 2015 · 2 revisions

Important: This is a draft document. use this workflow only after finalizing it.

Initial Setup

  • Fork the repo into your Account
  • Clone your repo into your local machine
  • Add upstream remote by using
  • git remote add upstream git@github.com:minimalparts/PeARS.git
  • fetch the development branch from the upstream : git fetch upstream
  • and create a local one based on it: git checkout -b development upstream/development

Branches

  • We will have two main branches, namely master and development
  • We will work on separate feature branches and will merge that branch into the development branch once it is ready. (so we will give pull request from feature branch to the development branch)
  • Once the development branch is stable and is ready for a release, we will merge that with the master branch

Working on a feature

Follow the following steps while working on a feature/bug

Working on a new feature (ie a new feature branch)

  • checkout the development branch by using git checkout development
  • pull the changes from upstream by using git pull upstream development
  • create a new feature branch by using git checkout -b feature-name (replace feature-name with the name of the feature that you are working on.)
  • do the coding
  • add the changes into staging by using git add <filenames separated by space>
  • commit the changes using git commit -m 'commit message'
  • again checkout the development branch by using git checkout development
  • pull the upstream changes using git pull upstream development
  • checkout to the feature branch using git checkout feature-name
  • rebase the feature branch using git rebase development ( and fix the merge conflicts if any)
  • push the changes into your origin remote by using git push origin feature-name
  • create a pull request from the feature branch to the development branch
  • Bingo :)

Working on an existing feature branch

  • checkout the feature branch using git checkout feature-name
  • do the coding
  • add the changes into staging by using git add <filenames separated by space>
  • commit the changes using git commit -m 'commit message'
  • again checkout the development branch by using git checkout development
  • pull the upstream changes using git pull upstream development
  • checkout to the feature branch using git checkout feature-name
  • rebase the feature branch using git rebase development ( and fix the merge conflicts if any)
  • push the changes into your origin remote by using git push origin feature-name
  • create a pull request from the feature branch to the development branch
  • Bingo :)