Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
in DevOps and Agile by (19.4k points)

Is there a way to do a git pull that ignores any local file changes without blowing the directory away and having to perform a git clone?

1 Answer

0 votes
by (119k points)
edited by

For me, the following worked:

(1) First fetch all changes:

$ git fetch --all

(2) Then reset the master:

$ git reset --hard origin/master

(3) Pull/update:

$ git pull

Also, check out this Git Tutorial to know more.

Browse Categories