merge - Git --no-merged with --squash -
i prefer merge feature branches --squash
lets me track when features added, , complete features need bisect
on. find gives nice representation of state of stable branch on time.
however, when using --squash
branches merged appear under --no-merged
instead of under --merged
. makes difficult keep track of state of each branch (i.e. when finished). not want delete 'finished' branches has happened have had check them out bisect further , other reasons (sometimes problem requires multiple paths of attack until solved, , have found valuable have documented).
it there way either:
- have
--merged
,--no-merged
recognise squashed branches have in fact been merged.
or
- archive merged (squashed) branches in sense not appear in either listing, still available if need them.
i prefer second solution if possible. there quite few non-current branches accumulating , hiding them make easier search list current branch looking for.
branches merged, if—and if—another branch has them direct or indirect parent (i.e. when following parents of commits, @ time reach branch). there no exceptions this.
when squash changes, creating new commit object contains changes 1 branch @ once. have “new branch” 1 commit, , old branch stays around keep original commits available. when merge, merge 1 commit, one’s branch gets merged.
so no, when squash changes, original branch still contains individual commits won’t recognized merged, because isn’t merged. there no way change behavior, or “archive” branch. thing create tag branch instead, marker, can delete branch itself.
however, proper way merge full branch. if saying want original branch “still available if [you] need them”. if want that, should keep original branch inside history, it’s real part of history.
if worry readability of history, should consider making non-fast-forward merges time, branches merge in appear separately on side.
Comments
Post a Comment