I have a file with multiple commits, I want to split this file into multiple files with single commit each.
For example :
A.cpp
has git history of :
commit message 1
. Egg dropping problem
commit message 2
. Invert a binary tree
I want to have two files named as
1. Egg dropping Problem.cpp
which contains data of commit 1
only.
2. Invert a binary tree.cpp
which contains data of commit 2
only.
git format-patch
format-patch
creates one patch file for each commit you specify.
# x is the number of commits you need
# git format-patch HEAD~X (or the next one:)
`git format-patch ~<first-sha1>`