TIL: Merge a specific commit from another Git remote

When you want to cherry pick a specific commit from another remote, you do NOT need to manually copy files or fetch a patch. It's git after all...

So when I try to cherry pick a commit from Kbin and merge it back into Mbin in cases we want changes back in Mbin as well you can use git cherry-pick.

But first follow these steps below, which assumes you already have cloned Mbin repository locally and are in the working directory of Mbin (eg. main branch):

git remote add kbin https://codeberg.org/Kbin/kbin-core.git
git fetch kbin
git checkout -b call-it-what-you-want  # Creates a new local feature branch

# Now check the log on the other remote and other branch
git log kbin/develop

# Finally, cherry pick the commit you want, use the commit hash here
git cherry-pick  <commit_hash>
breadsmasher ,
@breadsmasher@lemmy.world avatar

this post has a timestamp of an hour on the future

melroy OP Admin ,
melroy avatar

I didn't knew I could time-travel. Or it's a bug in either Lemmy or Mbin. Maybe some conversion missing with time-zones?

melroy OP Admin ,
melroy avatar
  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • tech
  • insurance
  • testing
  • drbboard
  • updates
  • til
  • programming
  • bitcoincash
  • marketreserach
  • wanderlust
  • Sacramento
  • All magazines