I'm starting a team project and my question is whether the order I'm following is correct when working with GIT
.
//Aqui baixo os arquivos mais recentes do projeto
I'm starting a team project and my question is whether the order I'm following is correct when working with GIT
.
//Aqui baixo os arquivos mais recentes do projeto
The right way is a bit relative, but I'll show you how it works with our team, maybe I can give you an idea.
Thehotfixbranchesareverysimilartobranchesreleases(branchesthataddnewfunctionality),astheyalsoprepareanewversiontobesenttoproduction,butitisnotplanned.Theirideaistosupplytheneedtoactimmediatelyaftersometroubleintheversionthatisinproduction.Whenacriticalerrorhappensitshouldberesolvedimmediately,soahotfixbranchshouldbecreatedfromthemaster.
Thebigbalconyofthisbranchisthatteammemberscancontinueprojectdevelopmentindevelop(orthenameofthemaindevelopmentbranchyouuse,I'llusedevelopheretostaymoreusuallyasanotherdeveloperquicklyfixesaproblemwithcrítico
.
Creatingahotfixbranch
hotfixbranchsarecreatedfrommaster.Forexample,let'ssayversion1.2istheversionthatisinproductionandduetoaseriouserror,itiscausingproblems.Changesmadetothedevelopbrancharestillunstable,andarenoteligibleforaproductionrelease.Weshouldthencreateahotfixbranchtofixtheproblem.
$gitcheckout-bhotfix-1.2.1master#Switchedtoanewbranch"hotfix-1.2.1"
$ ./bump-version.sh 1.2.1
# Files modified successfully, version bumped to 1.2.1.
$ git commit -a -m "Bumped version number to 1.2.1"
# [hotfix-1.2.1 41e61bb] Bumped version number to 1.2.1
# 1 files changed, 1 insertions(+), 1 deletions(-)
Do not forget to change the version number after creating the branch. Then send the changes to one or more commits. (If you use this versioning scheme)
$ git commit -m "Fixed severe production problem"
# [hotfix-1.2.1 abbe5d6] Fixed severe production problem
# 5 files changed, 32 insertions(+), 17 deletions(-)
Finishing a hotfix branch
When finished, a hotfix needs to be merge back to master and develop branches and now apply the back changes to your < strong> master .
$ git checkout master
# Switched to branch 'master'
$ git merge --no-ff hotfix-1.2.1
# Merge made by recursive.
# (Summary of changes)
$ git tag -a 1.2.1
Now, include bugfix in develop too:
$ git checkout develop
# Switched to branch 'develop'
$ git merge --no-ff hotfix-1.2.1
# Merge made by recursive.
# (Summary of changes)
The only exception to the rule here is when there is a current release branch, so the hotfix will merge with this branch and therefore merge into develop when the release is completed. If develop urgently needs this bugfix and can not wait, you can merge the release branch into the branch develop without loss.
And finally the hotfix can be removed:
$ git branch -d hotfix-1.2.1
# Deleted branch hotfix-1.2.1 (was abbe5d6).
You can find the whole process here in this article in Portuguese