Yet another sequence that worked (with some comments on each step):
Install git-svn
and subversion
toolkits:
sudo apt-get install git-svn subversion
Switch inside the PROJECT_FOLDER
cd PROJECT_FOLDER
Create the project path on the Subversion server (unfortunately the current git-svn
plugin has a defect in comparison with TortoiseSVN). It is unable to store source code directly into the PROJECT_FOLDER
. Instead, by default, it will upload all the code into PROJECT_FOLDER/trunk
.
svn mkdir --parents protocol:///path/to/repo/PROJECT_FOLDER/trunk -m "creating git repo placeholder"
This is the place where trunk
at the end of the path is mandatory
Initialize the git-svn
plugin context inside the .git
folder
git svn init -s protocol:///path/to/repo/PROJECT_FOLDER
This is the place where trunk
at the end of the path is unnecessary
Fetch an empty Subversion
repository information
git svn fetch
This step is helping to synchronize the Subversion server with the git-svn
plugin. This is the moment when git-svn
plugin establishes remotes/origin
path and associates it with the trunk
subfolder on the server side.
Rebase old Git commits happened before the git-svn
plugin became involved in the process (this step is optional)
git rebase origin/trunk
Add new/modified files to commit (this step is regular for Git activities and is optional)
git add .
Commit freshly added files into the local Git repository (this step is optional and is only applicable if step 7 has been used):
git commit -m "Importing Git repository"
Pushing all the project changes history into the Subversion server:
git svn dcommit