3
I’m setting up a development environment with Git in some of my projects, my initial idea for simple projects is:
- The master branch is blocked when someone needs to perform change is created a new branch (equal to master), change is made and the person opens a pull request to climb to master. So far okay.
The case I’m not sure about is when there are two development environments, for example: master (production) and develop (testing).
My idea was to develop being a copy of the master, when someone needs to make a change, a branch of the develop and when it’s finished it merges the branch into the develop.
At the time of merging from develop to master, if I’ve merged several branches to develop it, I can specify which branch I’ll go up to master?
Are there some more commonly used streams? Or best practices?
I don’t know if it’s clear but I can improve the explanation!
Updating:
I’ve reached a stream that I believe is viable:
Three environments built for two development environments
- Master
- Dev
- Testing
At first they are all the same, if someone needs to perform some Feature/Hotfix, it always creates a branch from the Dev, makes the change and merges with the branch Testing, if the tests are ok, the person merges his or her branch with the Dev, the branch Testing would always be there to test something and Dev would be all that is ready to go into production (master).
hello, can you give me a more practical example? Although I know git flow in practice with many people it’s complicated for me
– haykou
You have to take into account that Git Flow sets some rules for branch types, while at the same time defining what each branch type does. Take the image above. In practice, I use basically this way.
– Vinícius