When working on an internal repo which should be synchronized against a remote equivalent automatically, we have to set up a infrastructure first.

If an initial local repository (e.g. SVN) must be created first, please refer to this article (whereas I propose the second way without any rebasing).

1. We need git as well as its extension git-svn for working on the client site. We first establish a connection:

git svn clone https://server.com/REPO FOLDER

Note that the clone is only using the dedicated folder. The idea behind is that a more complex internal SVN is only partly mirrored to the remote portal.

2. Relocate the checked out data if necessary (e.g. if using a folder-structure generated from the CI-server).

3. Afterwards, we can retrieve recent changes via

git svn fetch

This command gets the most recent version and stores it in the branch refs/remotes/git-svn.

4. Don’t forget to set your user data:

git config --global user.name "USER"
git config --global user.email EMAIL</pre>

5. Set the new Git-location as origin:

git remote add origin git@github.com:GITUSER/REPO.git