To really use the power of git, the maintainer/development team should follow these instructions:
After making several changes including several features that you want to check into git:
- commit them all at once using
stash
as the commit message - Rename the current branch
stash
- Then branch the previous commit once for each "feature" or series of commits dependent upon each other, then on each new branch:
- cherry pick from the stash, but don't commit yet
- instead, curate the commit into just the code you want, deleting and staging files as necessary for the feature
- then commit it to the appropriate branch (if it asks to save a stash or discard it before switching, discard it, we've already saved our own stash)
- Once that's finished, branch the original commit as
master
- Then for each new branch:
- merge the branch 'as commit' into
master
- optionally, modify the commit message message to be more precise, concise, or descriptive
- Once all branches are merged back into
master
, rebasestash
ontomaster
- After working through merge conflicts,
stash
should be essentially the same asmaster
- If it is not, either:
- cherry pick and commit what's left back into
master
, or - if it deserves more than one commit, create a branch following the same procedure as before
- Once
stash
is essentially the same asmaster
, thestash
branch can be deleted
EOF