Git: How to squash all commits on branch

前端 未结 13 1925
情深已故
情深已故 2020-12-04 04:33

I make new branch from master with:

git checkout -b testbranch

I make 20 commits into it.

Now I want to squash those

13条回答
  •  春和景丽
    2020-12-04 05:10

    What you're doing is pretty error-prone. Just do:

    git rebase -i master
    

    which will automatically rebase only your branch's commits onto the current latest master.

提交回复
热议问题