I have a simple repository with linear history of commits, like:
[A] -> [B] -> [C] -> [D] -> [E] ...
I basically need to remove commits A and B so I thought I'd create a new repository and would like to achieve something like:
[X] -> [C] -> [D] -> [E] ...
So I created a new repository, manually created commit X that takes stores the relevant information from A and B and now need a command that will bring commits C, D, E etc. from the original repository and will put it on top of my new commit X.
How to do that?
Edit: Two problems I have with the suggested cherry-pick method are:
- Transferred commits lost their dates. Is there any way to preserve commit dates?
- When I fetched master from the original repository (and that remote master doesn't have any commit in common with the new repository), I have trouble deleting those fetched commits. When I do
git branch -D myoriginalrepo/master
, it says that no such branch exists while I can clearly see those commit in my GUI tool.