Skip to content

Instantly share code, notes, and snippets.

@megatux
Created April 16, 2013 18:32
Show Gist options
  • Select an option

  • Save megatux/5398353 to your computer and use it in GitHub Desktop.

Select an option

Save megatux/5398353 to your computer and use it in GitHub Desktop.
cheat sheet for rake, git, rvm, texmate, etc
bundle
------
bundle update
bundle show GEM_NAME
bundle exec ....
rake
----
rake db:create
rake db:setup
rake db:reset
rake db:seed
rake db:migrate
rake db:migrate:reset # borra schema.rb y rehace la BBDD y el schema.rb
rake db:rollback
rake db:rollback STEP=3
rake db:fixtures:load
rake db:schema:dump
rake db:schema:load
rake assets:precompile
rake log:clear
rake/rake test - Test all units and functionals
rake test:functionals - Run tests for functionalsdb:test:prepare
rake test:integration - Run tests for integrationdb:test:prepare
rake test:plugins - Run tests for pluginsenvironment
rake test:units - Run tests for unitsdb:test:prepare
rvm
---
rvm use ....
rvm list
rvm reload
Deploy
------
cap deploy
cap deploy:migrations
cap deploy:check
cap deploy:setup
cap deploy:update_code
Git feature branch cycle
------------------------
Aliases
-------
alias be="bundle exec"
git
---
git log -p
git commit --amend
git commit --amend --reset-author
git checkout -- . # descarta todos los cambios no staged (no new diles)
git clean -f -d # " " " new files
git branch -d rama
git branch -D rama # fuerza delete aunque no este mergeada
git push origin :rama_a_borrar / git push --delete origin pepito
git reset --merge # descarta merge state
git reset --hard SHA1
git remote prune origin #remove branches not in remote anymore
git fetch -p # removes old origin branches, not available anymore
### ver historia de un archivo borrado
git log --follow -- path/to/deleted/file
### recover deleted file $file is the file pathname
git checkout $(git rev-list -n 1 HEAD -- "$file")^ -- "$file"
### rollbacks local y remoto
git reset HEAD~1
git push -f origin HEAD^^:master
texmate
-------
cmd opt ] align hash
shift ctrl [ block format switch {} and begin / end
shift ctrl " alternate between "" '' %Q{} string definitions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment