# GIT workflow

# Working on a story

# Prepare a GIT branch

  1. git checkout master.
  2. git pull origin master.
  3. git checkout -b ID-XXX.
  4. git push origin ID-XXX.
  5. Create a Merge Request of PROJ-XXX to the parent branch. Add prefix Draft: to the title if the MR is not ready to be merged.

# Finishing the story

  1. Remove Draft: prefix from the title.
  2. Make sure you choose correct revieers.
  3. Wait for a code review.

Some projects need approve from the team leaders before deployment. Check for Deployment section in the project


# How to work with your peers on a single story

A story must be split into several sub-tasks. Everyone makes their own branch. The workflow is similar to working on a story:

  1. Checkout a current story branch git checkout ID-XXX.
  2. Sync with upstream git pull origin PRIDOJ-XXX.
  3. Create a new branch with subtask name git checkout -b ID-YYYY.

# Working on patches

Only `@tracker-team` uses that workflow.

# Preparing a branch for a patch

  1. Choose the latest patch version git pull --tags.
  2. Checkout the tag git checkout x.y.z.
  3. Make a new branch with prefix "patch-" git checkout -b patch-x.y.z.
  4. Push it git push origin patch-x.y.z.

Apply patch to upstream as well. Push MR or use cherry-picking.

# Cherry-picking bug-fixes from upstream

  1. Use git cherry-pick in order to collect all required bugs fixed from an upstream. E.g.: git cherry-pick ba47d721 -m 1. Also, you can use Gitlab UI to make a cherry-pick. Open merged MR and click a cherry-pick button.
  2. Push the branch git push origin patch-x.y.z.