[Tutorial] Installing an addon/skin using Git

  Thread Rating:
  • 3 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
htpc guy Offline
Posting Freak
Posts: 1,182
Joined: Oct 2010
Reputation: 7
Location: Near St. Louis Mo
Post: #1
I see this asked over and over again. I've probibly posted this same thing several times in an attempt to help someone out. So I decided I would post this here. Hopefully a kind moderator will stumble upon this and move it to the Tips and Tricks section and possibly Sticky it. Any addon/skin developer is welcome to link to this.

What is Git? This is from Wikipedia:
Quote:Git (/ɡɪt/) is a distributed revision control system with an emphasis on speed.[4] Git was initially designed and developed by Linus Torvalds for Linux kernel development. Every Git working directory is a full-fledged repository with complete history and full revision tracking capabilities, not dependent on network access or a central server. Git's current software maintenance is overseen by Junio Hamano. Git is free software distributed under the terms of the GNU General Public License version 2.
[INDENT]In short, for programmers its an efficient way for them to collaborate on a project. I'm not going to go too in depth here. There have been books written on the subject that go way beyond the scope of my discussion here. You are here because you want to install an addon/skin in xbmc using git. Why would you want to do this?[/INDENT]

Why?
[INDENT]XBMC has a ton of useful addons and you don't even have to get up off your couch to install them. On the other hand there are tons of equally cool addons that are only available here in the forums. If you want to install them then you have to grab the .zip file, copy it to your addon directory or install from .zip in xbmc. Its a pain, especially if you are just updating the addon. Then, after you install the addon with Git it is even easier to update it. You don't need to visit the forums. Just open the Git terminal, drop in a few easy commands and your addon is updated.[/INDENT]

But this command line stuff is scary!
[INDENT]Its not scary. Using a command line or terminal may seem nerdy but that is not a bad thing. Your computer is not going to self destruct if you do something wrong. Worst that can happen is you typo something. In this case the command line or terminal will tell you it can't do whatever it is that you are telling it to do. Nothing blows up. No kittens are murdered. You just have to retype your command. If you can type something into a Word document then you are more than qualified to follow the few easy steps that I will list below.[/INDENT]


How do I install an addon/skin suing Git?

[INDENT]Step 1: Install Git from here: http://git-scm.com/download
I'm not going to cover the installation. It is documented on the Git website, and really, if you need help installing a program then how on Earth did you install xbmc?[/INDENT]

[INDENT]Step 2:Locate a Git Repository
You have found a thread in the forums that informs you of a cool addon that you must have right now! Within the first post of the thread the author lists a url for a Git Repository. Following the link will take you to the addon authors Git Repository page. Make sure you have the Git radio button selected like in the picure. Copy the url from the text box. It will be formated like:[/INDENT]
Code:
git://gitorious.org/name-of-repo/name-of-addon.git
[Image: scaled.php?server=846&filename=g...res=medium]

[INDENT]Step 3:Open the Git Terminal[/INDENT]
[Image: scaled.php?server=825&filename=g...res=medium]

[INDENT]Step 4:Now change the directory to the path for your XBMC addons by typing in the text below. This will vary depending on your Operating System. Adjust the paths accordingly if you are not using Windows[/INDENT]
Code:
cd '/c/Users/[Username]/AppData/Roaming/XBMC/addons/'
[Image: scaled.php?server=828&filename=g...res=medium]

[INDENT]Step 5:Clone the Git Repository into your XBMC Addon Directory[/INDENT]
[INDENT]In the terminal, use the command "git clone" followed by the git url that you copied from the addons git repo in step 1. If you like at this point you can simply type "git clone" (without the quotes) and press insert on your keyboard (if you copied the git url to your clipboard). Now press enter and watch as Git downloads the addon directly to your XBMC addon directory. Its as simple as that. Now you just have to open XBMC and your addon is installed.[/INDENT]
Code:
git clone git://gitorious.org/xbmc-addon/cool-addon.git
[Image: scaled.php?server=851&filename=g...res=medium]


____________________________________________

How do I update an addon that I previously installed from Git?

[INDENT]Step 1: Open the Git Terminal and change directory to the location of the XBMC addon[/INDENT]
Code:
cd '/c/Users/[USERNAME]/AppData/Roaming/XBMC/addons/cool-addon'
[Image: scaled.php?server=560&filename=g...res=medium]

[INDENT]Step 2: Update your addon[/INDENT]
[INDENT]Now type "git pull" (without quotes) and your addon will be updated. No browsing to the forums or Git Repository. Its a simple as that![/INDENT]
Code:
git pull
[Image: scaled.php?server=69&filename=gi...res=medium]

How to use Git
| AMD Athlon II X3 Triple Core Processor 2.9 GHz |GIGABYTE GA-MA785GM-US2H Mobo 2GB DDR2 Ram | MSI N430GT |
| Logitec Harmony One Remote| 52" Sharp Aquos LED TV | Demon AVR-X1000 |
find quote