CountCet
CountCet

Reputation: 4573

git: not uptodate

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

Upvotes: 2

Views: 552

Answers (3)

Cascabel
Cascabel

Reputation: 496722

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

git checkout -f

or

git reset --hard

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

git clean -xdf

The -f tells clean to go ahead and remove the files (since this can be dangerous!), the -x tells it to delete ignored files too, and the -d tells it to delete entire untracked directories as well. To see what it's going to remove, change the -f to -n, for dry run.

Upvotes: 3

VonC
VonC

Reputation: 1323175

Why not clone the upstream repository again, in another place on your local disk?

Upvotes: 0

Vincent
Vincent

Reputation: 4933

git checkout -f 

After that you can do a

git pull

Upvotes: 1

Related Questions