Clone basic repo
git clone https://github.com/user1/project1
cd project1
Add external repo
git remote add oldrepo https://github.com/user1/project2
Get the old repo commits
git remote update
examine the whole tree
git log --all --oneline --graph --decorate
Copy (cherry-pick) the commits from the old repo into your new local one
git cherry-pick sha-of-commit-one
git cherry-pick sha-of-commit-two
git cherry-pick sha-of-commit-three
check your local repo is correct
git log
send your new tree (repo state) to github
git push origin master
remove the now-unneeded reference to oldrepo
git remote remove oldrepo
Top comments (0)