1

I am git as my control version for my code repository. As I am using multiple computer desktop and laptop.Each time when I try to pull the branch with new changes git give the following message.

  error: Your local changes to the following files would be overwritten by merge:
       ..../index.php
  Please, commit your changes or stash them before you can merge.
  Aborting

I do not want to stash the file . So I am deleting the file and doing git pull

Any other method is much appreciated.

made_in_india
  • 2,109
  • 5
  • 40
  • 63

1 Answers1

1

To reset just one file, as commented by greenkeeper, tou can simply checkout that file to reset its content to what the repo currently holds:

git checkout -- index.php

If you have multiple files modified locally, and you don't have any work in progress (or it would be lost), you can simply do before pulling:

git reset --hard

But again, that would reset all modified files.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250