tags:

views:

26

answers:

1

I want to get the latest file that's in the repo, and overwrite what I have locally.

how can I do this with git?

+3  A: 

If you want to overwrite only one file:

git fetch
git checkout origin/master <filepath>

If you want to overwrite all changed files:

git fetch
git reset --hard origin/master

(This assumes that you're working on master locally and you want the changes on the origin's master - if you're on a branch, substitute that in instead.)

Amber