English dictionary with notifications so you won't forget what you're studying!
Click here for more info about the app
The app that quizzes and scores you on your vocabulary!
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