I have two git repositories and a lot of untracked changes between them:
ftp --> C-- (untracked changes) --D
/ \
git A--B--C <-- old/master \
\
\
new/master --> D--E--F
How can I merge old repository into new repository to have a linear history like
A--B--C--D--E--F
EDIT:
inspired by How can I combine Git repositories into a linear history?
I've done:
git clone url://new new
cd new/
git remote add old url://old
git fetch old
git reset --hard origin/master
git filter-branch --parent-filter 'sed "s_^\$_-p old/master_"' HEAD
git push origin master
Only problem is that every commit from new/master was doubled (due to change of parent I think) so I've now (M is merge commit)
D---E---F--
\
A--B--C--D'--E'--F'--M
How can I easily remove unnecessary commits (D - F and maybe M)?