Skip to content

Instantly share code, notes, and snippets.

@ivanarrizabalaga
Created April 26, 2014 07:18
Show Gist options
  • Save ivanarrizabalaga/11313887 to your computer and use it in GitHub Desktop.
Save ivanarrizabalaga/11313887 to your computer and use it in GitHub Desktop.
Personal Git cheatsheet
//////////////////////
//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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment