1

I have created a fork of a repository (https://github.com/datso/react-native-pjsip) And made my own changes on him, but there's another repository with changes (https://github.com/moisesynfam/react-native-pjsip/commit/845801c331b9a530a542fc18fb88217ee6ee8f5c) that i want to make on my own repository (https://github.com/willnaoosmit/React-native-sip-pjsip)

It's there a way to commit on my repository a commit made by another user on another repository? Or i need to make this file to file by hand?

2 Answers2

2

You can have several remotes on your local copy :

  • choose how to name this second remote (I will use "moisesynfam" as an example) :

    git remote add moisesynfam https://github.com/moisesynfam/react-native-pjsip
    
  • fetch changes from this repo :

    git fetch moisesynfam
    
  • you can now access all of its published commits :

    git cherry-pick 845801c33
    

You can still push anything to your own clone using the origin remote :

git push origin ...
LeGEC
  • 46,477
  • 5
  • 57
  • 104
2

It's there a way to commit on my repository a commit made by another user on another repository? Or i need to make this file to file by hand?

You will need to use cherry-pick

Follow these steps:

# add the 2 remotes to your repository
git remote add <origin2> <url>

# "Grab" the content of all the branches
git fetch --all --prune    

# Checkout the destination branch
git checkout <branch>

# "Apply" the change
git cherry-pick <SHA1->

enter image description here


enter image description here

CodeWizard
  • 128,036
  • 21
  • 144
  • 167