< Development‎ | Tutorials
Revision as of 00:01, 2 November 2009 by Chani (talk | contribs) (added link to bestpractices)

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 https://svn.kde.org/home/kde/trunk/KDE/kdeedu
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://[email protected]/home/kde/trunk/KDE/kdeedu

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.

Content is available under Creative Commons License SA 4.0 unless otherwise noted.