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: Do I need to commit my branch before checking out another branch, what about stashing?
  • git repository structure with multiple modules
  • File diff against the last commit with JGit
  • Is there any way to force a git add ignoring line ending problems?
  • Why does git produce a merge conflict when when lines next to each other are changed?
  • which commits got cherry-picked
  • 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?

  • Is it possible to merge disjoint Git repos that were imported from the same CVS source?
  • Has no default translation and R is not being generated
  • gitignore all files of extension in directory
  • Does git track resource forks?
  • `git stash` during a merge conflict
  • Maven and Gitlab: release:prepare uses the wrong SCM URL
  • 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.