简体   繁体   中英

How to thoroughly clean up a ruby on rails project?

I am very new to ruby on rails. I've installed a complicated ruby on rails project via github clone and bundle install, and I was making minor changes to it until it reaches a point whereby it is not stable anymore, sass was throwing strange exceptions, so did other ruby gems. For a rails project, is there a way to clean up the project (aka, remove any "compiled or cached code") and just run again. My alternative now is to go thru github clone and bundle install again, but that means all of my modified changes have to be reapplied again. What is rails equivalent of "make clean" in Java? Is "rake clean" the answer? Do we need to run any bundle commands?

For directories managed by git, you can run:

git clean -ndx   # dry-run to make sure you don't lose anything important
git clean -dfx

This command cleans out your working tree. The specified command-line options include:

  • -n : Don't actually remove anything, just show what would be done.
  • -d : Remove untracked directories in addition to untracked files.
  • -f : Force the clean
  • -x : Don't use the ignore rules. This allows removing all untracked files, including build products. This can be used (possibly in conjunction with git reset) to create a pristine working directory to test a clean build.

See the git clean man page for more info.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM