What is the best git workflow?
Many people have different opinions on this subject.
The best according to me is to have a master
branch which contain
only deployable commits. Every commit on the master
branch could
potentially be deployed.
Every time you need to add a feature or fix a bug, create a branch,
work on it and when you are ready to merge it back to master
, do the
following:
- Test your changes
- Merge
master
on your feature branch - Test your changes again
- Merge your branch into
master
without fast-forward (this will create a commit even if there had been no changes in themaster
branch)
So that would look something like this:
That would allow the master branch to have a clean history.