Git usage: Difference between revisions

From Official Kodi Wiki
Jump to navigation Jump to search
>Theuni
No edit summary
>Theuni
No edit summary
Line 15: Line 15:
$ git svn init --stdlayout --prefix=origin/ https://xbmc.svn.sourceforge.net/svnroot/xbmc
$ git svn init --stdlayout --prefix=origin/ https://xbmc.svn.sourceforge.net/svnroot/xbmc
$ git config svn-remote.svn.tags tags/*:refs/tags/*
$ git config svn-remote.svn.tags tags/*:refs/tags/*
$ git config --remove-section remote.origin
</source>
</source>
NOTE: Don't forget the trailing '/' for the prefix option in 'git svn init'.
NOTE: Don't forget the trailing '/' for the prefix option in 'git svn init'.
NOTE2: The last command removes the git origin to keep you from fetching from there on accident. Things get ugly when pulling from git and svn simultaneously.  


Now do the fetch. If you left all branches and tags that were cloned alone, this should take roughly half an hour, as opposed to several days.
Now do the fetch. If you left all branches and tags that were cloned alone, this should take roughly half an hour, as opposed to several days.

Revision as of 18:58, 4 October 2009

There's now a git repository available for XBMC. This page is intended as an instructional page showing how to clone the XBMC git repository along with notes on how to start fetching newer revisions through XBMC's svn repository.

Eventually, the git repository will be the main repository for development. Currently, the git repository is synced with changes made to the svn repository every four minutes.

First thing, clone the repo.

$ git clone git://xbmc.git.sourceforge.net/gitroot/xbmc/xbmc

After cloning the repo, you may notice a lot of branches that are no longer in the svn repo, and also branches and tags which are appended with '@' followed by some number. These are all the branches and tags git-svn found when doing the initial import from the svn repo. If you do not intend to track svn, you may proceed to delete these stale branches, otherwise, you should keep them so that the time to do an initial fetch with git-svn doesn't take days (that's right, DAYS).

For all people wanting to track svn, setup the repo with git-svn. You'll need to use the 'origin/' prefix and change the location where the tags get placed with git-svn.

$ cd xbmc
$ git svn init --stdlayout --prefix=origin/ https://xbmc.svn.sourceforge.net/svnroot/xbmc
$ git config svn-remote.svn.tags tags/*:refs/tags/*

NOTE: Don't forget the trailing '/' for the prefix option in 'git svn init'.

Now do the fetch. If you left all branches and tags that were cloned alone, this should take roughly half an hour, as opposed to several days.

$ git svn fetch

Once finished, you should be at the master branch which tracks 'trunk' from svn. You can check by doing a dry-run of a check in to svn, via the dcommit command from git-svn.

$ git svn rebase
$ git svn dcommit -n
Committing to https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk ...

NOTE: Don't forget the '-n' option to perform a dry-run, otherwise it will try to perform an actual check in.

That's basically all there is to it. To keep following svn for new revisions, it's simply fetching new changes again and rebasing.

$ git svn fetch && git svn rebase

Other Repos

There are also other repos that are kept in sync with new changes from the svn repository.

A repository is available at github.

git://github.com/ceros/xbmc.git