Kodi Community Forum

Full Version: HOW-TO:Create add-on PRs using Git Subtree Merging
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello, I'm new to all this. I want to publish my addon.
My addon is a video addon and I want to publish it on jarvis.

I'm following the how-to on the wiki: http://kodi.wiki/view/HOW-TO:Create_add-...ee_Merging
and https://github.com/xbmc/repo-plugins/blo...IBUTING.md

I went online and forked xbmc/repo-plugins
then run the first step below on an empty folder on my computer:

Code:
$ git clone [email protected]:gedisony/repo-plugins.git
Cloning into 'repo-plugins'...
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

What went wrong?
Found the answer:

setup git by following instructions here:
https://help.github.com/articles/set-up-git/

it involves generating ssh keys with your email address and copy/paste it on github.com
just a FYI; you could also use https but then you'd have input credentials on every push.
I'm continuing the steps outlined here: http://kodi.wiki/view/HOW-TO:Create_add-...ee_Merging
after
Code:
git clone [email protected]:gedisony/repo-plugins.git
cd repo-plugins
# Assign the original repo to a remote called "upstream"
git remote add upstream https://github.com/xbmc/repo-plugins.git

Add the git repository where your addon resides as a remote:
Code:
$ git remote add plugin.video.reddit_viewer [email protected]:gedisony/plugin.video.reddit_viewer.git
$ git fetch plugin.video.reddit_viewer

Create a new branch for the addon:
Code:
$ git checkout -b new_branch plugin.video.reddit_viewer/master
Branch new_branch set up to track remote branch master from plugin.video.reddit_viewer.
Switched to a new branch 'new_branch'

The current directory should contain the files from the myaddon repository.
Code:
ls -la
* yes, the current directory now contains files for my addon *
continuing...

To switch back to gotham branch of the "repo-plugins" repository:
Note: gotham is just an example. Choose the branch which is the lowest version you want to support. The plugin is available for that version and later.
Code:
$ git checkout jarvis
error: pathspec 'jarvis' did not match any file(s) known to git.

I'm stuck at this error message. Any help?
After a LOT of trail and error, i made two bat files that seem to work for me. The first bat file runs the second bat file.

First bat: (makeprgk123.bat):
Code:
makepr-anyaddon.bat plugin.video.gamekings 1.2.3

Second bat (makepr-anyaddon.bat):
Code:
rem For a total restart: Delete repo-plugins from your repo on Github
rem For a total restart: Fork the official kodi repo to your repo on Github
rem Deleting C:\Kodi_stuff\repo-plugins and Cloning the kodi repo from your github to your pc
rem Ctrl-C to abort!!!!
pause
rmdir /s /q C:\Kodi_stuff\repo-plugins
cd C:\Kodi_stuff\
c:
rem Cloning the kodi repo from your github to your pc
git clone [email protected]:skipmodea1/repo-plugins.git repo-plugins
cd C:\Kodi_stuff\repo-plugins
rem Assign the official kodi repo to a remote called "upstream"
git remote add upstream https://github.com/xbmc/repo-plugins.git
rem Add the addon in your github as a remote
git remote add %1 [email protected]:skipmodea1/%1
rem Fetch your addon from your github
git fetch %1
rem Make a branch for your addon and go to that branch
git checkout -b b-%1-%2 %1/master
rem go to the gotham branch
git checkout gotham
rem delete the old version of the addon
git rm .\%1\ -r
rem get the new version of the addon from the branch you created
git read-tree --prefix=%1/ -u b-%1-%2
rem force remove .git files
git rm -f C:\Kodi_stuff\repo-plugins\%1\.gitattributes
git rm -f C:\Kodi_stuff\repo-plugins\%1\.gitignore
rem show the differences
git diff --staged
rem Commit the changes
Git commit -m "[%1] %2"
rem push the stuff to the gotham branch in your github (if everything went ok): git push origin gotham

Good luck.
You left your username in the batch file but no biggie.
Thank you very much!

I don't know how I ended up with my previous error but everything went well when I followed the steps in the batch file.

I should add:
after the steps in the batch file is complete, (I changed gotham to jarvis)
You need to go to github, on your account, I think a fork of "repo-plugins" will show up (as a result of doing the steps in batch file).
pick correct branch, click on new pull request,
(I'm not sure if I got this next part right because I see a "Can’t automatically merge" message.)
base fork: xbmc/repo-plugins base:jarvis ... head fork yourusername/repo-plugins compare:jarvis
click "Create pull request"