I'm starting to work with git for the first time, and I'm trying to come up with a workflow that works for me, so I thought of coming and asking around.
Right now, I'm in a couple of projects where I'm the only programmer and, in fact, the only pusher to origin.
I'm working like this, where c
is a commit, p
is a push and m
is a merge:
/feature2-c-c-c-c-m-c-c-c-c
/ / \
master-----------------------m-p------m-p
\ / \
\-feature1-c-c-c-c-c-c-c-c-c-c-m-c-c
Now I've gathered that rebasing would be more "correct" than those merge master
I do in the feature branches, or at least that's how it'd seem.. but I'm not sure I'm doing it right. What I've realized now is that by merging master into my other branches, I mess with my branch's history, and add all the unrelated features' commits to it.
Maybe I should branch more, by the subtask, adding a third level like this:
....................\
master---------------------------m-p--m-p-....
\ / \
\-feature1------------m-----------m.....
\ / \
\-feature11-c-c-c feature12-c-c-c..
This leaves unaddressed the fact that sometimes a feature is bigger than what a branch should be.
These are my thoughts on the matter so far, so I'm very open to suggestions on what's the best git workflow on one or two person teams.
I hope the diagrams are easy to follow.