< Development‎ | Tutorials
Revision as of 01:01, 2 November 2009 by Chani (Talk | contribs)

Jump to: navigation, search

Interfacing KDE's SVN repository with git-svn

Note: Please make sure to use Git 1.5.4 or better when you are interfacing with SVN. older versions of git-svn have many issues you might run into otherwise.

Note: git-svn is not able to track most of the svn:properties yet. So, e.g. svn:externals are not fetched.

Here I'm going to explain to you how to fetch KDE-EDU-trunk and import it into Git. I will then demonstrate how to make use of Git's features and sync with SVN again.

git svn init
git svn fetch -r798745

For those who don't have a password set up for https access, or who would rather use the more traditional SSH+SVN approach an alternate initialization line for the git repository (replace USERNAME with your username).

git svn init svn+ssh://

The revision has to be an existing revision of the module (to be found here).

To later update (sync with SVN) do:

git svn rebase

Now you can do everything you want, for example creating as many local branches as you like and merge back and forth. Whenever you want you can use this command to push your changes back into KDE's SVN repository:

git svn dcommit

Be warned, Git will create one SVN commit for each commit in your Git repository. To create just one commit for the whole merge of a branch into the master branch use the "--squash" feature like this:

git merge --squash mybranch

see Development/Tutorials/Git/BestPractices for guidelines on when to squash.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V.Legal