Everything you wrote until “subgit import” was correct. But you never need “subgit import” because “subgit import” is just for one time SVN->Git conversion, not for continuous synchronization.
Actually after “subgit install” you don’t need any command at all. Here’s why.
If you push to the Git repository, ‘pre-receive’ hook is automatically triggered and it sends to SubGit daemon a command to synchronize the change you’ve just pushed to SVN. No special command is required. If SubGit daemon is not running (e.g. if you restarted the server), the ‘pre-receive’ hook will start it and the daemon will stay in the background.
If you commit to SVN, SubGit doesn’t receives any notification automatically but SubGit daemon (if it’s running) checks for new changes in SVN once a minute (svn.fetchInterval option regulates this). So no special command is necessary again.
The only thing to do is to make sure SubGit daemon is running. You can always check it using ‘jps’ command which is provided together Java distribution.
$ jps | grep SubGitDaemon
This command (as well as SubGit daemon itself) should be run on behalf of ‘git’ system user (i.e. the same user as GitLab uses).
When you run ‘subgit install’, it starts the daemon automatically, so unless you restart the server. If you restart the server, it’s enough to either push to the Git repository to start SubGit daemon. If you have nothing to push, you can use this command
git push -q origin --delete refs/subgit/command/fetch
git push -q $FULL_GIT_URL --delete refs/subgit/command/fetch
It’s a command to delete an artificial non-existing branch. This will trigger ‘pre-receive’ hook, which will start SubGit daemon. The daemon will interpret this as a command to perform SVN<->Git synchronization immediately.
Finally, you can use ‘subgit fetch’ command (on behalf of ‘git’ system user) for starting SubGit daemon after restarting the server. It also just starts SubGit daemon and performs SVN<->Git synchronization.
There’s a number of other ways to configure SubGit but the easiest thing to do is just to do nothing. If you push to the Git repository more or less regularly, you don’t have to worry about SubGit daemon.
So my answers to your questions are:
1. How can I do the same from the GitLab repository to the SVN repository means when I update the GitLab repository first and SubGit will update the SVN repository?
Just push to GitLab, this will trigger ‘pre-receive’ hook, which will tell the daemon to perform synchronization. Even if you change GitLab somehow without triggering the hook, wait a minute, and the synchronization will be performed automatically. If you don’t want to wait, push something to GitLab, e.g. a deletion of a non-existing branch.
2. Can this mirroring be done automatically means without running any command (subgit import and git push)?
Yes, this is already performed automatically in both directions, you never need to run “subgit import”.