https://stackoverflow.com/questions/5308816/how-can-i-merge-multiple-commits-onto-another-branch-as-a-single-squashed-commit
15 Answers
29
Suppose you worked in feature/task1 with multiple commits.
Go to your project branch (project/my_project)
git checkout project/my_project
Create a new branch (feature/task1_bugfix)
git checkout -b feature/task1_bugfix
Merge with the
--squash
optiongit merge --squash feature/task1
Create a single commit
git commit -am "add single comments"
Push your branch
git push --set-upstream origin feature/task1_bugfix
沒有留言:
張貼留言