简体   繁体   中英

git: on the server, divert pushes to one branch to another

I'd lke to set up my git server so that any pushes to, say, master are turned into pushes to master-unchecked ; obviously to then run something server-side that verifies that the changes are ok, before moving them to master (bypassing the diversion locally).

Is that possible using, some of the git server management tools like gitolite, gitosis or gitano?

Note that I'd like to avoid the developers to manually have to run git push origin master:master-unchecked .

This is generally best managed with an intermediate repository.
That way, you don't have any question to ask regarding the destination branch: it is master anyway.

A post-receive hook can then test, and if the test is successful, push to the final target repo.

Note: gitolite (leaving aside gitosis, which is dead since 2010) is an authorization layer, not a workflow manager. It isn't needed for the intermediate repo.
It can be needed for the final repo in order to prevent any push.

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