I have been using git for a while now primarily on CLi. I am the only person
working on this project so far. I just have 1 master branch and 1 production
branch. The production branch is named such that all tests in that branch
pass. I work directly on the master branch.
I had a issue recently, which prompted me to think that perhaps I wasn't using
the best practices. I finished working on a featureA, and started working on
featureB. While working on featureB, I made some changes to the code for
featureA, but didnt run the tests for featureA. Later while running the
tests for featureB, I also decided to check that featureA works, and tests
for featureA stopped working. This prompted me to think of how I am defining a feature and perhaps I should be able to isolate the work I do on each feature. This would help me quickly figure out what changes have led to this bug. Its only in hindsight that I am defining these as featureA and featureB.
While talking to some other people, I realized that I am supposed to be using branches for each feature, and then merge them as I complete each feaure.
To figure out an appropriate workflow, I came across 2 main workflows:
gitflow proposed by Vincen:
http://nvie.com/posts/a-successful-git-branching-model/
and
github-flow proposed by Github: https://guides.github.com/introduction/flow/
and have also reviewed multiple other documents such as:
code review with git-flow and github,
comparisons of the 2 workslows: https://www.youtube.com/watch?v=nPNA8ZfDjKM
From these, it seems that gitflow is too much of a
overhead, since I am working by myself. So I thinking of using github flow.
Question
- I understand that I should create branches off master, in the
GitHubflow model of working. However, how do you define a feature? Because I am working by myself on this codebase, I considered the entire package as a feature, and which led me to working on a single branch. However, after reading theGithhub flowandgitflowmodels, it seems the definition of feature is much more granular. I haven't come across a definition of what a feature stands for in these and other documents I have read so far. Is a feature a function, a class? I also use the github issues periodically to file away changes that I think would be useful, but I dont have time now. Should I use theGitHubissues to create issues, and then use them to create features out of them?