Last active
October 26, 2020 16:34
-
-
Save leandro-hermes/bc399e21547e1e1d8db4013afe668210 to your computer and use it in GitHub Desktop.
Limpa branches do repositório local e aplica o git flow
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo " | |
#### | |
# Baixando repo atualizado | |
#### | |
" | |
git fetch origin -p | |
git checkout main | |
echo " | |
#### | |
# Removendo branches | |
####" | |
BRANCHES=$(git branch | awk -F ' +' '! /\(no branch\)/ {print $2}') | |
for branch in $BRANCHES; do | |
if [ $branch != "main" ]; then | |
git branch -D "$branch" | |
fi | |
done | |
echo " | |
#### | |
# Inicializando Git Flow | |
####" | |
printf "%s\n%s\n\n\n%s\n\n\n%s\n\n" main develop homolog/ v | git flow init -f | |
echo " | |
#### | |
# Sincronizando branch 'develop' com 'origin' | |
####" | |
git checkout develop | |
git branch -u origin/develop | |
[ -f "gitflow.sh" ] && rm -f gitflow.sh | |
echo "Concluído" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Depois de instalar o git-flow, fazer o seguinte em cada repositório: