Reputation: 3333
I have pushed a last version of project to Git.
And I would like to make an experiment: I change a file development.rb.
And I run git pull I expect that my local file development.rb will be replaced by remote file development.rb. But it doesn't. Why?
Upvotes: 0
Views: 110
Reputation: 8819
This is because your HEAD is either at the same point of ahead of what is on the remote branch. I assume your development.rb file has not been committed locally, so you can:
git checkout HEAD development.rb
To remove local changes to development.rb.
Upvotes: 0
Reputation: 53581
That's not how git works. If you do:
git status
You'll see that you have a pending local change.
You can throw away this change and revert to the last commit with:
git checkout -- development.rb
Upvotes: 3
Reputation: 24802
you should git checkout development.rb
first, or the git pull
will try to merge remote changes with your local changes.
Upvotes: 0