How do I squash two non-consecutive commits?

前端 未结 5 2173
执笔经年
执笔经年 2020-11-30 17:16

I\'m a bit new to the whole rebasing feature within git. Let\'s say that I made the following commits:

A -> B -> C -> D

Afterward

5条回答
  •  天命终不由人
    2020-11-30 18:04

    For those using SourceTree:

    Make sure you haven't already pushed the commits.

    1. Repository > Interactive Rebase...
    2. Drag D (the newer commit) to be directly above A (the older commit)
    3. Make sure commit D is highlighted
    4. Click Squash with previous

提交回复
热议问题