I have a gogs repository which is loaded from local directory (I will clone git repo to that local repository periodically). In repository settings there is an option called "Sync now" to sync the repository. How to invoke this Sync now option via a jenkins job. Is there any api for Syncing the repository. Thanks in advance.
I think Gogs provides an API for syncing. If you do have the personal access token from your Gogs account, you can trigger the repo sync.
Replace
YOUR_PERSONAL_ACCESS_TOKENwith the token you generated, 'YOUR_GOGS_URLwith the URL of your Gogs instance,OWNERwith the owner of the repository, andREPO_NAMEwith the name of the repository.Now all you have to do is schedule a Jenkins job to run in time intervals which will sync on regular basis.