git 'fatal: pathspec did not match any files' after moving things around

I was trying to change the directory structure of my repository, as detailed in this question (following the accepted answer). Things seemed fine after moving the directory, though it didn’t recognise the files in their new location, and I got frustrated and just re-added everything. Now every file that I try to git-add comes back as ‘fatal: pathspec FILE did not match any files’.

I honestly don’t know how to diagnose the problem, and I don’t want to blunder forward and screw things up even further. Any advice on how to proceed?

  • git merge --no-commit with edits
  • How can I sort a set of git commit IDs in topological order?
  • Git pull not working properly?
  • Setup Maven Repository on private server to share the android library for Android Studio
  • Git - Ignore node_modules folder everywhere
  • GitHub for Mac no longer installs Git message
  • (git version on OS X 10.8.2, if it’s relevant)

  • Multi-Device Hybrid Apps installation error
  • Should these auxiliary files be under Git version control?
  • Is git stash branch-specific or for the whole repository?
  • Where does the command `git remote add` make changes to?
  • Is there a a way that a Git server will support svn clients requests
  • Github: Detecting pull requests and their size
  • One Solution collect form web for “git 'fatal: pathspec did not match any files' after moving things around”

    Bah, this was my own stupid fault. When it didn’t recognise the files in their new location following the accepted answer in the linked question, I futzed around with the other answers to see if I could get it to work, and I think that I ended up changing the worktree directory to the old subdirectory by mistake. Thus, it wasn’t seeing anything in the root directory. Modifying .git/config to set worktree to the current root of the repo fixed the issue.

    Git Baby is a git and github fan, let's start git clone.