Skip to content

Git Flow

dyadyaJora edited this page Mar 25, 2019 · 7 revisions

Description

Try to use classic git-flow process with some changes

Branches

Static branches

  • dev - main branch for development; current source code; all PR must go here; need reviews; need run CI;
  • master - stable version; must be deployable; need updates every week;
  • staging - branch with beta-code (dev-code); for autodeploy on test(beta) server;

Development branches

Rules

  • To create branches for the task you need from the branch dev.
  • Ready branches merge into dev.
  • Merging to dev ONLY via Pull Request:
    • Must be reviewed by 2 contributors
    • CI passed

Dev-branch naming

Using pattern [feature|bugfix|hotfix]/issue[number]_[branch-name] How to check branch "first-name":

  • feature - for enhancement/feature functionality
  • bugfix - for removing bugs in code
  • hotfix - inly for critical bugs

Example:

  • feature/issue1_back-sockets
  • bugfix/issue2_front-assembly
  • hotfix/issue3_xss-inject

Git comands help

Start project

Cloning via https

git clone https://github.com/itmo-cet-sem/franky.git .
cd ./franky

Cloning via ssh

git clone [email protected]:itmo-cet-sem/franky.git .
cd ./franky

How to run project - read in README.md

Branch lifecycle

Before start: git fetch --all git checkout dev git pull origin dev

Start:

  1. git checkout dev checkout in "fresh" dev
  2. git checkout -b [branch-name] create new branch for task
  3. codding
  4. git add [files]
  5. git commit -m "[commit message]"
  6. while task not ready repeat from 3.
  7. git push origin [branch-name]
  8. open PR

Before merge(resolve conflicts with rebase):

  1. git co [your-branch-name]
  2. git fetch --all
  3. git rebase origin/dev
  4. fix conflicts
  5. git rebase --continue
  6. while have conflicts repeat from 4.
  7. git push origin +[your-branch-name] force push

Merge:

  • Using github button after success PR
  • or git checkout dev && git merge [your-branch-name] (restricted)

After merge:

  • Delete branch with github
  • or git push origin --delete [your-branch-name]

Make release

@todo