How to remove selected commit log entries from a Git repository while keeping their changes? -


I would like to delete the log entries selected from a linear committed tree, so that the Entry Commit Log

My tree looks like something:

  r - a - b - c - d - e - head  

I I would like to remove the B and C entries so that they do not show the commit log, but changes in ADE should be preserved. Perhaps by starting a single commitment, so that B and C.B becomes and the tree looks like this.

  R - A - BC - D - e - head  

Or, ideally, comes directly after ADD. To represent change B from D, B to C and C to D.

  R - A - D - e - head  

Is this possible? if so, how?

This is a new project which does not have any branch now, so also there is no merger.

does the same way.

$ git rebase -i HEAD ~ 5

is an example.

  1. Do not use GIT-Rebase on public (remote) commits.
  2. Make sure your operating directory is clean ( commit or print your current changes).
  3. Run the above order. It launches your $ EDITOR . Change the first c and D to change> squash . It will be mixed in C and D in B. If you want to delete the commute, then just delete its line.

If you are lost, type:

  $ git rebase --bort  
< / Html>

Comments