How to make Cherry-pick from another git repository?

Asked

Viewed 118 times

2

I wanted to know how I copy a commit from one project to another.

I thought it would just be git cherry-pick 76a99b8c395ebbc40a07c04dc9e0d9fefc9982cd, but that’s only if I’m within the same project, when I want to move from one branch to another.

Like I do from one project to the other?

  • Cherry pick doesn’t roll. What you can try is to generate a patch of that commit and apply it to the other Object. This question may help you https://answall.com/questions/148309/quando-devo-usar-um-patch

  • You want to move from one project to another, that’s it ?

1 answer

0

You can do this by adding the other Git repository as remote.

git remote add projeto-b ~/projetos/projeto-b
git fetch projeto-b
git cherry-pick <commit1>..<commit2>
  • This will depend on whether the repositories have the same origin... But, if they have the same origin, it’s not that the commit is being sent to another Object, but to the remote of this

Browser other questions tagged

You are not signed in. Login or sign up in order to post.