Git: don't promote

I am new to git. I forked another repository a while ago. I wanted to start a fresh start, so I grabbed my private clone and added a remote for the upstream repository. I can't pull from the repository because it says some files are not out of date. I don't care about these files, I want everything from a remote pool. Is there a way that I can quickly resolve this?

+2


source to share


3 answers


To check all files as they should be according to the repository, try either

git checkout -f

      

or

git reset --hard

      



Sometimes you may need to delete any untracked / ignored files that might conflict with things that have been added upstream since then:

git clean -xdf

      

-f

indicates to clean up all files and delete them (as this can be dangerous!), -x

tells him to delete ignored files as well, and -d

tells him to delete entire unexplored directories like Well. To see what he was going to remove, change -f

on -n

to dry running.

+3


source


git checkout -f 

      

After that you can do



git pull

      

+1


source


Why not re-clone the upstream repository elsewhere on your local disk?

0


source







All Articles