Easily build a great vocabulary without studying! Now on the App Store!
Click here for more info about the app

git checkout -- file-in-question.oh-my


Problem: using git and one file, like your db/schema.rb, is out of whack with the latest branch. If you run git pull and you get a failed merge and no update. You can of course, edit the conflicts manually. But what if you're confident that the latest schema.rb is correct? Instead of manually editing the file and doing all that work, you can grab the latest copy with the git checkout command.

Solution:  git checkout -- <file> ... or for the Rails application example above... git checkout -- db/schema.rb

Tagged w/ #development #git #source controlprogramming