Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
インタラクティブなリベースを実行し、最初のコミットを言い換えて、その他すべてを修正できることはわかっています。しかし、ブランチに何百ものコミットが含まれていると、非常に面倒になります。
もっと簡単な方法はありますか?
git merge --squashブランチにマージする際に、コミットを単一のコミットに押しつぶすために使用できます。
git merge --squash
ターゲットブランチに切り替える
$ git checkout target-branch
次に使用します
$ git merge --squash original-branch
のすべてのコミットはoriginal-branch1 つのコミットにマージされ、target-branch.
original-branch
target-branch