简体   繁体   中英

How do I set up git to warn me if I am about to push to master in a specific repo?

我想知道如果我尝试直接推送到我的远程主服务器上是否可以得到警告。

Git pre-push hooks is what you are looking for

You could use a client side hook or a server side hook depending on your needs.

All about hooks: http://git-scm.com/book/en/Customizing-Git-Git-Hooks

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