I started to implement a GIT repository following a specific Workflow. The workflow is the following:
v0.1 v0.2
/ /
releases-------------------------------------------------
/ | |
main--------------------------[0.1]---------------[0.2]
\ / \ /
development--- / \ /
\ / \ /
feature-ABC feature-XYZ
maincontains the latest stable code where any developer can justgit checkout -> build -> deploymaincontains tags used to identify arelease- Every release version is branched into
releasebranch developmentis the starting branch for a developer. After acommitthe Build Server will Build/Deploy the solution into adevelopment environment- If a Dev needs to work on a story/feature they branch from
developmentand push back intodevelopmentwhen done using a branch naming offeature/nameorhotfix/bugname - When
developmentgets stable, it is merged back intomainand the release is tagged and get deployedin staging - a Release version is created into
release
Questions
Now, in order to adopt this workflow, I created a sequence of GIT commands that a developer should execute. Can you verify the correctness?
Also, how can I ensure that main and development are always properly in sync?
First Time (assuming there is no development branch yet)
$ git checkout master
$ git branch -b development
$ git push -u origin development
Development starts
$ git checkout development
$ git branch -b feature/my_feature
... iteration ...
$ git add ...
$ git commit -m "My Comment"
$ git push origin feature/my_feature
... iteration ...
Developer is done with Feature/Bug
$ git checkout development
$ git merge feature/my_feature
... resolve conflicts ...
$ git commit -m "Merge from feature/my_feature"
$ git push -u origin development
Tester approve latest Development release
$ git checkout master
$ git merge development
... resolve conflicts ...
$ git tag -a v0.1 -m "my version 0.1"
$ git commit -m "Merge from development"
$ git push -u origin master --tags
$ git checkout master
$ git branch v0.1
$ git commit -m "my version 0.1"
$ git push -u origin v0.1