DEV Community

Discussion on: Impress hiring managers by presenting your React projects like a pro - Part 2

Collapse
 
aliarslanansari profile image
Ali Arsalan Ansari

You should have 3 branches
master/main
qa
development

And seperate branch for each feature which gets deleted after merging.
First make a pr on development, if it's working properly and create a pr from development to QA, then after testing from create PR from QA to master/main

Collapse
 
jkettmann profile image
Johannes Kettmann • Edited

Honestly, I don't think that's necessary. Yeah, some teams work like that. My current team also uses a development and master branch. But it highly depends on the deployment process. And tbh it's quite annoying if you use mandatory code reviews and want to deploy often.

If you use continuous deployment in combination with preview branches you use a super modern and professional workflow. It works like this:

  • You have one branch called main (or master or whatever)
  • You create new branches from main to implement your features
  • You create a PR to merge the branch into main
  • The PR gets deployed to a temporary domain where you can test the code in production conditions
  • If everything is alright you merge the branch
  • the main branch is then automatically deployed to production (this is called continuous deployment)

In a real team your coworkers would ideally review your code to improve quality.

Deploying the branch is usually a bit tricky if you set up deployment yourself. But in your own projects you can simply use Vercel or Netlify. They are free, easy to set up and give you advanced features like branch previews out of the box.

Collapse
 
dawnind profile image
Mainak Das

Wow that's quite a long process 😅

Will try to follow the steps 😇

Thread Thread
 
jkettmann profile image
Johannes Kettmann

See my comments above. No need to overthink git for your own projects imo 😊

Thread Thread
 
dawnind profile image
Mainak Das

You're right, creating 2-3 branches for prod, prev and dev in personal projects is kinda stretch !
As I use vercel the branch preview does the job !

Collapse
 
jkettmann profile image
Johannes Kettmann

Btw if you where hinting at the good old "git flow" there's no need for it for a typical web app. The author himself recommend against using git flow for web apps as you can read on the original article