Git Flow desde el terminal
5 de junio del 2018
Instalación
OS X – Homebrew
1 |
$ brew install git-flow |
Linux
1 |
$ apt install git-flow |
Inicializar Git
1 2 3 4 5 6 |
$ cd mi/proyecto $ git init $ git add . # Sólo si ya tienes archivos en tu proyecto $ git commit -am "Initial commit" $ git remote add origin git@github.com:username/project-name.git $ git push -u origin master |
Prepara el repositorio para la rama develop
Creamos la rama develop y la subimos al repositorio.
1 2 |
$ git checkout -b develop $ git push -u origin develop |
Asegúrate de configurar ‘develop’ como la rama por defecto en GitHub.
Configuración de Git Flow
Se te pedirá, como se muestra a continuación, qué ramas deseas utilizar en cada caso. Simplemente puedes pulsar ‘Enter’ en todas.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
$ git flow init Which branch should be used for bringing forth production releases? - develop - master Branch name for production releases: [master] Which branch should be used for integration of the "next release"? - develop Branch name for "next release" development: [develop] How to name your supporting branch prefixes? Feature branches? [feature/] Release branches? [release/] Hotfix branches? [hotfix/] Support branches? [support/] Version tag prefix? [] |
Ejemplos de uso
Nueva Feature
1 |
git flow feature start MY_FEATURE |
Terminar Feature (merge a develop)
1 |
git flow feature finish MY_FEATURE |
Crear Release
1 |
git flow release start 1.0 |
Terminar Release
1 |
git flow release finish 1.0 |
Nuevo Hotfix
1 |
git flow hotfix start BUGFIX |
Subir Hotfix (master)
1 |
git flow hotfix finish BUGFIX |