Back

Explore Courses Blog Tutorials Interview Questions
0 votes
1 view
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.

Welcome to Intellipaat Community. Get your technical queries answered by top developers!

28.4k questions

29.7k answers

500 comments

94.1k users

Browse Categories

...