Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set subgit to work after rebooting

Tags:

subgit

I’m trying to translate our subversion repository to git using subgit tool. I established subversion to git repositories successfully and it has been working normally some time, but changes from subversion stopped to appear in git after I rebooted by workstation. I ran subgit install once again and it works for now, but I think it’s not correct way. How can I set subgit so that it continues to work after reboot?

like image 789
dnov Avatar asked Nov 28 '25 06:11

dnov


1 Answers

Indeed, SubGit runs a daemon to check for new SVN changes (once a minute by default). The daemon starts automatically if not started on every Git push, so if Git pushes to your repository occur often enough and you don't care much about having new SVN changes immediately, you can just do nothing and with the first Git push the daemon will start.

But if it's important for you to have Git repository up-to-date, you need to run

$ subgit fetch --async /path/to/git/repository

when the system starts. The command will start the daemon synchronizing the repository with SVN. Note that it's important to run all SubGit commands including this one on behalf of the same user (it should also be the owner of /path/to/git/repository ; usually, it's "git" if you're using GitLab or "www-data" if you're using Apache and git-http-backend ).

One of the approaches would be to create an init.d script starting SubGit daemon with

$ su -u git subgit fetch --async /path/to/git/repository

and stopping it with:

$ su -u git subgit shutdown /path/to/git/repository

If your system is debian, you can use this init.d script generator.

I'm one of SubGit developers.

like image 67
Dmitry Pavlenko Avatar answered Dec 02 '25 03:12

Dmitry Pavlenko



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!