controle_de_versao:git
Diferenças
Aqui você vê as diferenças entre duas revisões dessa página.
| Ambos lados da revisão anteriorRevisão anteriorPróxima revisão | Revisão anterior | ||
| controle_de_versao:git [2014/08/17 15:28] – edição externa 127.0.0.1 | controle_de_versao:git [2014/11/11 16:04] (atual) – [Bloquear push no master] Édson Kuzniewski | ||
|---|---|---|---|
| Linha 4: | Linha 4: | ||
| [[wppt> | [[wppt> | ||
| + | ===== Bloquear push no master ===== | ||
| + | [[https:// | ||
| + | [[http:// | ||
| + | [[http:// | ||
| + | <file sh .git/ | ||
| + | #!/bin/bash | ||
| + | |||
| + | protected_branch=' | ||
| + | current_branch=$(git symbolic-ref HEAD | sed -e ' | ||
| + | |||
| + | if [ $protected_branch = $current_branch ] | ||
| + | then | ||
| + | read -p " | ||
| + | echo | ||
| + | if echo $REPLY | grep -E ' | ||
| + | then | ||
| + | exit 0 # push will execute | ||
| + | fi | ||
| + | exit 1 # push will not execute | ||
| + | else | ||
| + | exit 0 # push will execute | ||
| + | fi | ||
| + | </ | ||
| + | < | ||
| + | chmod +x pre-push | ||
| + | </ | ||
| ===== Programa para utilizar o git localmente ===== | ===== Programa para utilizar o git localmente ===== | ||
| [[http:// | [[http:// | ||
| Linha 70: | Linha 96: | ||
| ==== Checkout ==== | ==== Checkout ==== | ||
| '' | '' | ||
| - | |||
controle_de_versao/git.1408300111.txt.gz · Última modificação: (edição externa)
