fatal: Not a git repository: /Users/Mathias/Projects/punycode.js/.git/modules/vendor/docdown

enter image description here

I got “fatal: Not a git repository” when performing git add node_modules, which is a node module directory.

  • git: how to not delete files when rebasing commits with file deletion
  • Rename Git branch folder
  • Git mergetool vs difftool
  • Branch or tag before, or else prepare a potential build failure after successful git pull?
  • Github: separate pull requests for unrelated minor changes?
  • Where the git clone passwords are being stored or cached?
  • it looks like one of the modules triggers this msg:


    I searched all “fatal: Not a git repository” on stackoverflow and tried the “git init” approach. It doesn’t work in my situation.

    Can you help?

  • Creating a new minor version between two releases
  • Eclipse Git Error: Error occurred computing diffs
  • How to connect to a remote GIT repository?
  • Android Studio, Git and three ways merge
  • The Git Bash console crashes on open
  • git show old version of file in editor
  • 3 Solutions collect form web for “fatal: Not a git repository: /Users/Mathias/Projects/punycode.js/.git/modules/vendor/docdown”

    If you already have a package.json file, create a .gitignore file in the root of your repo with this line in it:


    There’s really no need to commit node_modules since someone else can run npm install and get the same dependencies.

    I encountered this error when trying to setup a CI process using CruiseControl.Net. I eventually found that running the following, was enough to cure the error.

    npm install punycode

    This allowed the build to proceed, however fell over again when Cruise Control was running “git clean -f -d -x”. This was due to the really deep network of folders installed in node_modules – file names too long for windows to cope!

    For the time being, I switched of the clean with



    I had the same issue.

    Are you using url “0.7.9” as dependency just like me? What I had to do to get rid of this problem was just update url version to “0.10.1” in my package.json.

    The issue is explained here.
    Bump url dependency 0.7.9 -> 0.10.1 #10


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