[Android Builders Collective] ezio84:
My way (thanks to a lot of xda people).

Repo sync the slimkat stock repo on your local disk.

Then fork on your github the Slim projects you want to modify with cherrypicks (e.g. frameworks_base-->https://github.com/SlimRoms/frameworks_base, there's a Fork button on the top right).

Go into your slimkat/.repo/manifests/default.xml and copy the row relating the project, e.g.:

<project path="frameworks/base" name="SlimRoms/frameworks_base" remote="github" revision="kk4.4" />

Now go into slimkatrepo/.repo/local_manifests and create a new file called local_manifest.xml (you should already have it if you use loonybin), with this parsing:

<?xml version="1.0" encoding="UTF-8"?>
<manifest>
XXXXXXXXXX
</manifest>

Between the "manifest" tags you can specify which projects you want to remove or add, so add the line you copied and insert "remove-" before "project" to remove the slim stock project (you can also delete "revision" and "remote" from the copied line):

<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<remove-project path="frameworks/base" name="SlimRoms/frameworks_base" />
</manifest>

Then add your forked project:

<project path="frameworks/base" name="YourGithubName/frameworks_base" remote="github" revision="kk4.4" />

So the file will be:

<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<remove-project path="frameworks/base" name="SlimRoms/frameworks_base" />
<project path="frameworks/base" name="YourGithubName/frameworks_base" remote="github" revision="kk4.4" />
</manifest>

Well, now everytime you'll repo sync, git will use your forked projects instead of Slim ones.

NB: do a repo sync after changing lines in the manifest!

Now git checkout to a local branch (NB: use "-b" just the first time to create the branch, next times git checkout kk4.4 without "-b"):

git checkout -b kk4.4

and cherrypick the commit you want on this local branch.

To cherypick from gerrit you can just copy the cherrypick code in the commit page, to cherrypick from github there are two ways:

git remote add NameYouWant https://github.com/CyanogenMod/android_framework_base
git fetch NameYouChoseAbove
git cherry-pick COMMITid

https://github.com/CyanogenMod/android_frameworks_base/commit/ae74d12c57cf039fbaedd2b95f0ae13535575f8e
Split it to:
https://github.com/CyanogenMod/android_frameworks_base.git
and
ae74d12c57cf039fbaedd2b95f0ae13535575f8e
Then in your frameworks/base:
git fetch https://github.com/ae74d12c57cf039fbaedd2b95f0ae13535575f8e.git && git cherry-pick ae74d12c57cf039fbaedd2b95f0ae13535575f8e

Solve conflicts (then "git add -A", "git commit -a" or "git cherry-pick --continue"), compile your build to test the feature, if all is fine push the cherrypick to your fork:

git push https://github.com/YourGithubName/frameworks_base kk4.4

So every time you'll repo sync, no need to add that cherrypick again:cool:

If you want to revert (delete) a cherrypick, just revert it:

git checkout kk4.4
git revert --COMMITid

and push the revert to your fork too:

git push https://github.com/YourGithubName/frameworks_base kk4.4

If there's a new patchest for the commit you cherrypicked, do always a revert of the previous patchset, push the revert on the fork, cherrypick the new patchset, push it to the fork. So you'll have on github an history of what you did, and issues will be avoided.

But you will say: "but github forks are not synced with the Slim stock projects!".

Here's the solution:

git remote add slimroms https://github.com/SlimRoms/frameworks_base
git fetch slimroms
git checkout kk4.4
git merge slimroms/kk4.4

Solve conflicts if needed, then push the merge to your fork:

git push https://github.com/YourGithubName/frameworks_base kk4.4

------

It's also a good idea to have a cloned slim stock repo in another disk folder, to try cherrypicks and send patchsets to the slim gerrit avoiding dependencies with external commits or mods you did on the forked projects.

So, in a new folder on your disk:

repo init -u git://github.com/SlimRoms/platform_manifest.git -b kk4.4
git clone https://gerrit.slimroms.net/SlimRoms/frameworks_base

Then git checkout a local branch:

git checkout kk4.4

To sync the cloned project don't use "repo sync" but:

git pull

If you want to remove a cherrypick before git pull, just do git log, see the commit-id preceding the cherrypicked commit, and:

git reset --hard COMMITid