Git rebase (Merge Squash) my feature branch onto another branch -
i'm looking git command me feature branches when they're ready go master. git command squash changes on branch single commit on top of master. today with:
git rebase origin/master git rebase -i head~4
where 4 number of commits squash. however, requires me know how many commits have. today running:
git log head...origin/master
and counting commits.
i feel though there should better way this. or how else it, too?
all have is:
git checkout feature_branch git rebase master git checkout master git merge --squash feature_branch
as docs git merge --squash
say:
produce working tree , index state if real merge happened (except merge information), not make commit or move head, nor record $git_dir/merge_head cause next git commit command create merge commit. allows create single commit on top of current branch effect same merging branch (or more in case of octopus).
after that, can git commit
changes staged.
Comments
Post a Comment