when investigating on bug, sometime not working when digging down on several branches many commits.
hopefully once done it, merge working result master branch git merge yeah_i_got_it. here repository might in such situations:
v there bug here a---b---c----------------------------------------------f (master) \ / o---o---o--o--o (bug) / \ / o---o--o--o (oups_this_way_better) / \ v clean bit / o---d---e------------------o (yeah_i_got_it) ^ solved bug here eventually expect keep relevant commits @ end of day:
a--b--c--d--f (master) regarding rest, garbage , don't need it. so, best way deal unpleasant workflow?
because git keeps after garbage branches removed, useful option git give importance flag each commit in order me cleaning repository after rush. in repositores can identify useless commits, commits may useful 1 day, commits usefull and, last not least, important commits need keep along branches.
getting rid of useless commits takes me lot of time. need review log back, identify ones want eliminate , job no mistake.
so question is:
how eliminate temporary commits , branches git repositories definitively?
here random thoughts:
- my workflow bad, should never work that.
- just add prefix each temporary commits comments "junk" or "garbage".
- a native git solution may exist can me job
git rebase-and-clean yeah_i_got_it --keep d
the way you're asking checkout master @ c, git merge --squash yeah_i_got_it. collapse whole branch 1 commit.
another way rebase-interactive commits, git rebase -i master yeah_i_got_it branch. in interactive rebase mark e "fixup". if commit message began "fixup!" , had appropriate git config options set, marking done automatically.
note: want a-b-c-d-f, think want a-b-c-d. there's no need "f" commit.
Comments
Post a Comment