I was trying to cherrypick this commits
from https://github(dot)com/AICP/frameworks_base/ to https:// github(dot)com/Gopinaidu7/android_frameworks_base
I created a new branch with name master and switched to it.
I then did:
git cherry-pick 59ebfb7
and it got
fatal: bad revision '59ebfb7'
I also tried:
git cherry-pick 59ebfb7146616e57c15469d7ea85c4362c2fab3c
and got this error
fatal: bad object 59ebfb7146616e57c15469d7ea85c4362c2fab3c.
I was doing wrong and did tried to pick those commits since last night.
I was not able to do it, can someone point me with correct commands in sequence?
It is possible to cherry pick from another repo using the command line. You will first need to add the other repository as a remote and then fetch the changes. From there, you should be able to see the commit in your repo and cherry pick it.
In order to get commits from the other repository, You'll need to add the other repository as a remote, then fetch its changes. From there you see the commit and you can cherry-pick it.
Open up Team Explorer and check out the branch you want to cherry-pick changes into using the Branches view. Right-click the branch containing the changes you want and select View History.... Right-click the commit you want to cherry-pick and select Cherry-pick.
You can use the GitLab UI to cherry-pick single commits or entire merge requests. You can even cherry-pick a commit from a fork of your project. Support for tracking commits cherry-picked from the command line is tracked in this issue.
You need to add that other repo as a remote first:
git clone https://github.com/Gopinaidu7/android_frameworks_base
cd android_frameworks_base
git remote add other https://github.com/AICP/frameworks_base
Then fetch:
git fetch other
Now you can cherry-pick using the SHA1. And then push.
If the cherry-picked commit is a merged commit:
git cherry-pick -m 1 59ebfb7
You don't need to create a new branch, just clone the target branch as suggested by @Vonc, and then run this command:
git checkout target_branch
git fetch https://github.com/AICP/frameworks_base && git cherry-pick 59ebfb7
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With