• HTML
  • HTML5
  • CSS3
  • JavaScript
  • SCSS
  • TypeScript
  • AngularJS
  • ReactJS
  • Angular
  • Vue
  • Nuxt
  • Next
  • SolidJS
  • PHP
  • Python
  • Golang
  • Rest API
  • (g)RPC
  • NodeJS
  • Gin

Git Flow Strategy 2

Hieu TranDecember 12, 2023, 3:08:00 AM GMT+0

When I have to manage a platform, and our team have to to develop multiple features at the same time, however, release all of some of those features will be decided in the QA phase, and after some discussion, we decided to use this git flow strategy to solve our problems.

Repository Setting up

// Check the currently registered remote list
git remote -v

// Reset the remote address information for the main repository
git remote add upstream https: //github.com/company/project.git

// Check if it is properly registered
git remote -v

// Correct configuration output result
origin https: //github.com/hieutran/project (fetch)
origin https: //github.com/hieutran/project (push)
upstream https: //github.com/company/project.git (fetch)
upstream https: //github.com/company/project.git (push)

// If the main repository is set as origin
git remote remove origin

// Reset the remote address information for the personal repository
git remote add origin https: //github.com/hieutran/project

Setting up image, diagram, git flow guide
Setting up diagram

Work on a task git flow

// Checkout the working branch to work
git checkout origin feat/task-1

// Commit code to private repo
git add .
git commit -m 'feat: finish task #1'
git push origin task-1

Gitflow image describes how to do a task, diagram, git flow guide
Create a branch to to a task diagram

Pull Request git flow

Craete a PR diagram image, diagram, git flow guide
Pull Request diagram

Merge and Deployment

// Fetch the release-1 branch of main repo into release-1 branch of local
git checkout release-1 (don't need upstream)
// If already fetch the release-1 branch to the local, use the bellow

// command to get the latest code of the branch.
git pull upstream release-1

// Merge code at local, and push into the private repo
git add .
git commit -m 'conflict: solved conflict: #1 a.json line 2'
git push origin release-1

How to merge code and deploy a feature image, diagram, git flow guide
Merging & Deployment diagram
The footer will display soon!