There is what we call feature branch in git.
Imagine for example I am making a game and I need to add a Power-up
feature.
How I see my commits names with feature branches:
Branch name: Adding Power-up.
First commit name: Added prefab.
Second commit name: Implemented graphics.
Third commit name: Added collision detection.
Fourth commit name: Added effect on player on collision.
How I see my commits names without features branches:
First commit name: Adding power-up: added prefab.
Second commit name: Adding power-up: added graphics.
Third commit name: Adding power-up: added collision detection.
Fourth commit name: Adding power-up: added effect on player on collision.
When commit were files, I would make a directory called Power-up
and put prefab
, graphics
, collision detection
, effect on player on collision
inside that folder.
Another usage of git branches is to separate dev version from production version.
- If my intuition is correct, are git feature branches comparable to folders on explorer, and git master and dev branch comparable to environments?
- Have I miss another "type" of branch?
- If there is distinct types of branches, should git add some structuring? (like a command called
git featureBranch <newBranchName>
orgit environmentBranch <newBranchName>
maybe)
Reference(s):
- https://www.atlassian.com/git/tutorials/comparing-workflows/feature-branch-workflow
- https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow