Hoy tenía que recoger la habitación y aunque no descarto que la hoja en cuestión acabe teniendo valor histórico creo que es momento de volcarlo a un mini-post que me sirva como 'cheatsheet' personal.
Hay 1000 recursos por ahi fuera mucho más estructurados y más completos, esto es simplemente mi versión ultrasimplificada
Los comandos hacen referencia a un hipotético escenario donde se trabaja sobre 3 entornos (desarrollo, staging, produccion), desplegando la aplicación sobre Heroku.
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
////////////////////// | |
//DEVELOPMENT | |
////////////////////// | |
//Checkout development branch and check | |
git checkout develop | |
git branch | |
//Code for a while | |
emacs.... | |
//Commit changes | |
git commit -a -m "Life is wonderful" | |
//Push changes | |
git push origin develop | |
////////////////////// | |
//STAGING | |
////////////////////// | |
//Merge changes | |
git checkout staging | |
git merge develop | |
//Everything is ok, commit to staging | |
git push origin staging | |
//Deploy to Heroku staging | |
git push staging-heroku staging:master | |
////////////////////// | |
//PRODUCTION | |
////////////////////// | |
//Merge changes | |
git checkout master | |
git merge staging | |
git push production-heroku master:master | |
////////////////////// | |
//OTROS | |
////////////////////// | |
//Work with branches locally | |
git checkout --track origin/develop | |
//Update local repo (non existing branch) with remote branch | |
git branch -f --track develop origin/develop | |