0

I've got a git repo with Wordpress as a submodule. I was trying to update Wordpress and really screwed things up. I just want to get all of the code from the 3.7.1 tag in the remote repository, but this doesn't work;

git fetch --tags
git checkout 3.7.1

Leaves a bunch of either "untracked files" or "uncommitted changes". I don't know what I'm doing wrong. I've tried so many things to get this submodule onto the 3.7.1 tag and nothing seems to work. If anything, I feel like I'm just making the problem worse. It shouldn't be that hard to just reset the code from the tag I want and discard everything else. Any help?

Jo Sprague
  • 16,523
  • 10
  • 42
  • 62

1 Answers1

1

Here's the git nuclear option:

git clean -dfx             # delete everything in the worktree that isn't tracked
git reset --hard           # wipe all modifications to tracked files
git checkout 3.7.1

which looks appropriate here.

jthill
  • 55,082
  • 5
  • 77
  • 137
  • Thanks. Yes. This is what I ended up doing. In this case it didn't matter, but for future reference; does `git clean -dfx` delete ignored files as well? – Jo Sprague Nov 29 '13 at 13:30