I created a new feature branch and added a file there. Every commit after creating that branch only targets this file.
Now I want to move those commits to a new repository that is just for this new file.
How do I achieve that? I tried to add the old repository as remote branch to the new repository and cherry-pick all commits but I also get older commit messages from before the feature branch and from other files and I lose the original commit dates.
So this is what I need:
- copy/move a range of commits from one repo to another
- only the commits of that file beginning from creating that file to today (there are no other files involved in between, but before creating the old feature branch)
- keep original authors and commit dates
What I've also tried:
# git rebase --onto develop oldRepo/feature/issue#14 c7bc952
where c7bc952 is the current HEAD.
What I got:
First, rewinding head to replay your work on top of it...
# git status
HEAD detached from 4ae31a1
nothing to commit, working directory clean