Login | Register


Migrating to Git

This tutorial is addressed to the entire OpenSIPS community, both developers and users. It aims to help you migrate to one of our New Repositories, depending on your preferences and needs.

I am a Read-Only User...

  • and I have an old SVN checkout and I don't want to do a fresh checkout
In order to keep your sources up-to-date we strongly recommend you to configure your SVN repository to point to the new SourceForge SVN repository. This can be achieved using the svn relocate command (or for older svn versions svn switch --relocate command).
Example: to migrate an old OpenSIPS 1.9 SVN checkout to the new SourceForge SVN repository you can use:
svn relocate https://svn.code.sf.net/p/opensips/svn/branches/1.9
or (if previous command returns Unknown command: 'relocate')
svn switch --relocate https://opensips.svn.sourceforge.net/svnroot/opensips/branches/1.9
After changing the SVN URL, you will be able to pull the updates from SourceForge in the same way you were doing until now, using the svn update command.

  • I want to do a fresh checkout, but I don't like git
You will still be able to do a SVN checkout on the new SourceForge repository. However, you should strongly consider the migration to a git repository, since on long term we are planning to move completely on GitHub, and the repository might become obsolete.
Example: if you want a fresh checkout of the 1.9 branch, you should use:
svn checkout https://svn.code.sf.net/p/opensips/svn/branches/1.9

  • and I am willing to use a fresh git clone
This is the option we recommend. If you are not that familiar with git, we recommend you to go through the official Git Manual.
Example: in order to do a new clone of the 1.9 branch, you can do:
git clone -b 1.9 https://github.com/OpenSIPS/opensips.git opensips_1_9

I am a Developer...

Important: starting with the migration, you will no longer be able to use SVN to push changes to OpenSIPS. Since the Git versioning system is a bit different than SVN, we strongly recommend you to go through the Git Official tutorial. The following tutorial contains a few steps.

In order to commit on the new Git repository, you first have to clone it. Important: in order to push your changes on the GIT HTTPS repository, your GIT version has to be greater than 1.7.10. A different option is to initially clone the GIT SSH repository, so your push will be authenticated by ssh.
Example: in order to clone the 1.9 branch, you have to run:
git clone -b 1.9 https://github.com/OpenSIPS/opensips.git opensips_1_9
or (for git versions lower than 1.7.10)
git clone -b 1.9 git@github.com:OpenSIPS/opensips.git opensips_1_9
Make the necessary changes and then commit them on your local repository:
Example: commit the changes on the main.c file
git add main.c
git commit -m 'Commit message for main.c modifications'
Ensure that your repository is up-to-date - fetch any changes (and also rebase).
Example: to fetch the changes from 1.9 branch of the origin repository
git pull --rebase origin 1.9
Push your changes upstream.
Example: to push the changes from the local branch to the remote 1.9 branch of the origin repository, use:
git push origin 1.9


Page last modified on May 23, 2013, at 12:05 PM