How to merge git commits from other remote origin

Git Feb 6, 2024
  1. Add the remote
git remote add <new_remote> <url>
  1. Create a new branch tracking that remote
git checkout -b <new_branch> --track <new_remote>/main
  1. Cherry-pick the commits you want
git cherry-pick <commit_hash_old>^..<commit_hash_new>
  1. Resolve any conflicts and continue
git cherry-pick --continue

All done!

Tags

Sophie Cao

(she/they, elle/iel, 她/佢)