简体   繁体   中英

Is there are way to lock/unlock central git repository?

I have two jobs which should be executed at one time. Both of them updating and pushing changes to central git repo. Is there way to lock central repo, so first job will lock it, perform update and realize at the same time second job will wait until repo would be unlocked.

This is probably a bad idea, but you can have these jobs set up a push hook on the remote, that rejects all pushes but those coming from that job.

When the job's finished, deregister the hook and you should be good to go. Beware that this is bound to lead to problems, when you don't properly handle errors in your jobs.

To set up such a hook, check the git-recieve-pack documentation

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM