# GIT workflow

# Working on a story

# Prepare a GIT branch

  1. git checkout master (some projects can use develop for upstream).
  2. git pull origin master
  3. git checkout -b PROJ-XXX
  4. git push origin PROJ-XXX
  5. Create a Merge Request of PROJ-XXX to the parent branch (master, develop or maybe hotfix-*) with prefix Draft:.

# Finishing the story

  1. Remove Draft: prefix from the title of Merge Request.
  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 PROJ-XXX.
  2. Sync with upstream git pull origin PROJ-XXX.
  3. Create a new branch with subtask name git checkout -b PROJ-YYYY.

# Working on patches

Only `@tracker-team` uses that workflow.

# Preparing a branch for a patch

  1. Pull all the tags git pull --tags.
  2. Choose a version for the hotfix git tag -l --sort=-v:refname.
  3. Checkout the latest patch git checkout 9.12.4.
  4. Make a new branch with prefix "patch-" git checkout -b [release|patch]-9.12.5.
  5. Push it git push origin [release|patch]-9.12.5.
  6. Create an MR: [release|path]-9.12.5 to develop. That reminds you to merge patches to the upstream.

# 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 [relase|patch]-9.12.5.
Last Updated: 11/22/2021, 9:23:22 AM